PagesSection.TagMapping Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a collection of TagMapInfo objects.
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
Property Value
A TagMapCollection of TagMapInfo objects.
- Attributes
Examples
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"));
' 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"))
Remarks
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.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈