PagesSection.TagMapping 属性

定义

获取 TagMapInfo 对象的集合。

public:
 property System::Web::Configuration::TagMapCollection ^ TagMapping { System::Web::Configuration::TagMapCollection ^ get(); };
[System.Configuration.ConfigurationProperty("tagMapping")]
public System.Web.Configuration.TagMapCollection TagMapping { get; }
[<System.Configuration.ConfigurationProperty("tagMapping")>]
member this.TagMapping : System.Web.Configuration.TagMapCollection
Public ReadOnly Property TagMapping As TagMapCollection

属性值

TagMapCollection

一个由 TagMapCollection 对象构成的 TagMapInfo

属性

示例

下面的代码示例说明如何使用 TagMapping 属性。

// 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"));
' Get all current TagMappings in the collection.
Dim k As Int32
For k = 1 To pagesSection.TagMapping.Count
  Console.WriteLine("TagMapping {0}:", i)
  Console.WriteLine("  TagTypeName = '{0}'", _
   pagesSection.TagMapping(k).TagType)
  Console.WriteLine("  MappedTagTypeName = '{0}'", _
   pagesSection.TagMapping(k).MappedTagType)
Next

' Add a TagMapInfo object using a constructor.
pagesSection.TagMapping.Add( _
 New System.Web.Configuration.TagMapInfo( _
 "MyNameSpace.MyControl", "MyNameSpace.MyOtherControl"))

注解

TagPrefixInfo对象在 ASP.NET 页上没有相应的指令。 对象 TagPrefixInfo 允许在编译时将标记类型名称重新映射到其他类型名称。

适用于