1 out of 12 rated this helpful - Rate this topic

TagBuilder Class

Represents a class that is used by HTML helpers to build HTML elements.

System.Object
  System.Web.Mvc.TagBuilder

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)
public class TagBuilder

The TagBuilder type exposes the following members.

  NameDescription
Public methodTagBuilderInitializes a new instance of the TagBuilder class.
Top
  NameDescription
Public propertyAttributesGets or sets the collection of attributes for the tag.
Public propertyIdAttributeDotReplacementGets or sets the character that is used to replace the periods (dots) in the id attribute.
Public propertyInnerHtmlGets or sets the inner HTML for the tag (element).
Public propertyTagNameGets or sets the name of the tag.
Top
  NameDescription
Public methodAddCssClassAdds the specified CSS class to the tag-builder attributes.
Public methodEqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGenerateIdGenerates the id attribute for the tag by using the specified name.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodMergeAttribute(String, String)Adds an attribute to the tag by using the specified key/value pair.
Public methodMergeAttribute(String, String, Boolean)Adds an attribute to the tag by using the specified key/value pair.
Public methodMergeAttributes<TKey, TValue>(IDictionary<TKey, TValue>)Adds an attribute to the specified collection of attributes for the tag.
Public methodMergeAttributes<TKey, TValue>(IDictionary<TKey, TValue>, Boolean)Adds an attribute to the specified collection of attributes for the tag.
Public methodSetInnerTextSets the inner text of the tag (element).
Public methodToString()Returns a string that represents the current object. (Overrides Object.ToString().)
Public methodToString(TagRenderMode)Returns a string that represents the current object by using the specified tag-render mode.
Top
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.