共用方式為


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 可讓您在編譯時期將標籤類型名稱重新對應至其他類型名稱。

適用於