TagBuilder Class
Represents a class that is used by HTML helpers to build HTML elements.
Namespace:
System.Web.Mvc
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
The TagBuilder type exposes the following members.
| Name | Description | |
|---|---|---|
|
Attributes | Gets or sets the collection of attributes for the tag. |
|
IdAttributeDotReplacement | Gets or sets the character that is used to replace the periods (dots) in the id attribute. |
|
InnerHtml | Gets or sets the inner HTML for the tag (element). |
|
TagName | Gets or sets the name of the tag. |
| Name | Description | |
|---|---|---|
|
AddCssClass | Adds the specified CSS class to the tag-builder attributes. |
|
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
|
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
|
GenerateId | Generates the id attribute for the tag by using the specified name. |
|
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
|
GetType | Gets the Type of the current instance. (Inherited from Object.) |
|
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
|
MergeAttribute(String, String) | Adds an attribute to the tag by using the specified key/value pair. |
|
MergeAttribute(String, String, Boolean) | Adds an attribute to the tag by using the specified key/value pair. |
|
MergeAttributes<TKey, TValue>(IDictionary<TKey, TValue>) | Adds an attribute to the specified collection of attributes for the tag. |
|
MergeAttributes<TKey, TValue>(IDictionary<TKey, TValue>, Boolean) | Adds an attribute to the specified collection of attributes for the tag. |
|
SetInnerText | Sets the inner text of the tag (element). |
|
ToString() | Returns a string that represents the current object. (Overrides Object.ToString().) |
|
ToString(TagRenderMode) | Returns a string that represents the current object by using the specified tag-render mode. |
Wrong assembly name
In .Net 4, this class is no longer in System.Web.Mvc.dll. It is now in System.Web.WebPages.dll.
$0$0
$0
$0The namespace is still System.Web.Mvc, so just another reference you need to have to use it.$0
- 8/31/2011
- Charles Boyung