This documentation is archived and is not being maintained.

TagPrefixInfo.TagPrefix Property

Gets or sets the tag prefix that is being associated with a source file or namespace and assembly.

Namespace: System.Web.Configuration
Assembly: System.Web (in system.web.dll)

public string TagPrefix { get; set; }
/** @property */
public String get_TagPrefix ()

/** @property */
public void set_TagPrefix (String value)

public function get TagPrefix () : String

public function set TagPrefix (value : String)

Not applicable.

Property Value

The tag prefix.

The TagPrefix property defines the alias used for the namespace where the control resides. It applies to user and custom controls. This is the value that would precede the tag name in the ASP.NET code. For example "myTag" in <myTag: myControl />.

The following code example shows how to use the TagPrefix property. This code example is part of a larger example provided for the PagesSection class.

// Get all current Controls in the collection.
for (int i = 0; i < pagesSection.Controls.Count; i++)
  Console.WriteLine("Control {0}:", i);
  Console.WriteLine("  TagPrefix = '{0}' ",
  Console.WriteLine("  TagName = '{0}' ",
  Console.WriteLine("  Source = '{0}' ",
  Console.WriteLine("  Namespace = '{0}' ",
  Console.WriteLine("  Assembly = '{0}' ",

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0