TagMapCollection.Item Property (Int32)

 

Gets or sets the TagMapInfo object at the specified index location.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

public TagMapInfo this[
	int index
] { get; set; }

Parameters

index
Type: System.Int32

The index of a TagMapInfo object in the collection.

Property Value

Type: System.Web.Configuration.TagMapInfo

The TagMapInfo object at the specified index, or null if there is no object at that index.

If a TagMapInfo object already exists at the specified index, this property overwrites it; otherwise, it creates a new object and adds it to the collection.

The following code example shows how to use the Item property. This example is part of a larger example provided for the PagesSection class.

// Get all current TagMappings in the collection.
for (int i = 0; i < pagesSection.TagMapping.Count; i++)
{
  Console.WriteLine("TagMapping {0}:", i);
  Console.WriteLine("  TagTypeName = '{0}'",
      pagesSection.TagMapping[i].TagType);
  Console.WriteLine("  MappedTagTypeName = '{0}'",
      pagesSection.TagMapping[i].MappedTagType);
}

.NET Framework
Available since 2.0
Return to top
Show: