PagesSection.TagMapping Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets a collection of TagMapInfo objects.

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

[ConfigurationPropertyAttribute("tagMapping")]
public TagMapCollection TagMapping { get; }

The TagPrefixInfo object has no corresponding directive on an ASP.NET page. The TagPrefixInfo objects allow you to remap tag type names to other type names at compile time.

The following code example shows how to use the TagMapping property.

// 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);
}

// Add a TagMapInfo object using a constructor.
pagesSection.TagMapping.Add(
    new System.Web.Configuration.TagMapInfo(
    "MyNameSpace.MyControl", "MyNameSpace.MyOtherControl"));

.NET Framework
Available since 2.0
Return to top
Show: