TemplateInfo Class

Encapsulates information about the current template context.

Inheritance Hierarchy


Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)


Public Class TemplateInfo
Dim instance As TemplateInfo
public class TemplateInfo
public ref class TemplateInfo
type TemplateInfo =  class end
public class TemplateInfo

The TemplateInfo type exposes the following members.


  Name Description
Public method TemplateInfo Initializes a new instance of the TemplateInfo class.



  Name Description
Public property FormattedModelValue Gets or sets the formatted model value.
Public property HtmlFieldPrefix Gets or sets the HTML field prefix.
Public property TemplateDepth Contains the number of objects that were visited by the user.



  Name Description
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetFullHtmlFieldId Retrieves the full DOM ID of a field using the specified HTML name attribute.
Public method GetFullHtmlFieldName Retrieves the fully qualified name (including a prefix) for a field using the specified HTML name attribute.
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)
Public method Visited Determines whether the template has been visited by the user.



The TemplateInfo class is used to retrieve metadata for templates or HTML helpers that you create. You can access the TemplateInfo instance from the ViewDataDictionary. The TemplateInfo instance can not be accessed outside a template.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also


System.Web.Mvc Namespace