System.Web.Configuration.TagPrefixInfo Class

Defines a configuration element containing tag-related information.

See Also: TagPrefixInfo Members

Syntax

public sealed class TagPrefixInfo : System.Configuration.ConfigurationElement

Remarks

The System.Web.Configuration.TagPrefixInfo class allows you to programmatically access and modify tag-prefix information stored in a configuration file. It provides the same functionality as the ASP.NET @Register directive. Tag prefixes associate a "namespace" in ASP.NET to the assemblies and namespaces that must be included for custom controls and user controls to work properly. System.Web.Configuration.TagPrefixInfo objects are stored as members of a System.Web.Configuration.TagPrefixCollection object. The System.Web.Configuration.TagPrefixCollection class allows you to programmatically access and modify the controls subsection of the pages section of a configuration file.

System.Web.Configuration.TagPrefixInfo objects are added to the collection using the add element and specifying a value for the tagPrefix attribute along with values for other relevant attributes. The other required information varies based on the kind of control you will use with the specified tag prefix:

The same tagPrefix value can be used to map to multiple assemblies or namespaces.

Note:

When a source is specified, the user control itself must not be in the same directory as the page. If it is, you get a run-time error when you attempt to load the page.

Requirements

Namespace: System.Web.Configuration
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0