TagPrefixCollection Class
Assembly: System.Web (in system.web.dll)
The TagPrefixInfo class allows you to programmatically access and modify tag-prefix information stored in a configuration file. Tag prefixes associate a "namespace" in ASP.NET with the assemblies and namespaces that must be included for custom controls and user controls to work properly.
TagPrefixInfo objects are stored as members of a TagPrefixCollection object. The TagPrefixCollection class allows you to programmatically access and modify the controls subsection of the pages section of a configuration file.
The following configuration file excerpt shows how to declaratively specify values for several properties of the TagPrefixCollection type.
<system.web>
<pages>
<controls>
<clear />
<remove tagPrefix="MyTags" />
<!—- Searches all linked assemblies for the namespace -->
<add tagPrefix="MyTags1" namespace=" MyNameSpace "/>
<!-- Uses a specified assembly -->
<add tagPrefix="MyTags2" namespace="MyNameSpace"
assembly="MyAssembly"/>
<!-- Uses the specified source for the user control -->
<add tagprefix="MyTags3" tagname="MyCtrl" src="MyControl.ascx"/>
</controls>
</pages>
</system.web>
The following code example shows how to use the TagPrefixCollection class to programmatically modify tag-prefix settings. This code example is part of a larger example provided for the PagesSection class.
System.Configuration.ConfigurationElement
System.Configuration.ConfigurationElementCollection
System.Web.Configuration.TagPrefixCollection