TemplateInfo Class
Encapsulates information about the current template context.
Inheritance Hierarchy
System.Object
System.Web.Mvc.TemplateInfo
Namespace: System.Web.Mvc
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
Syntax
'Declaration
Public Class TemplateInfo
public class TemplateInfo
public ref class TemplateInfo
The TemplateInfo type exposes the following members.
Constructors
Name | Description | |
---|---|---|
TemplateInfo | Initializes a new instance of the TemplateInfo class. |
Top
Properties
Name | Description | |
---|---|---|
FormattedModelValue | Gets or sets the formatted model value. | |
HtmlFieldPrefix | Gets or sets the HTML field prefix. | |
TemplateDepth | Contains the number of objects that were visited by the user. |
Top
Methods
Name | Description | |
---|---|---|
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.) | |
GetFullHtmlFieldId | Retrieves the full DOM ID of a field using the specified HTML name attribute. | |
GetFullHtmlFieldName | Retrieves the fully qualified name (including a prefix) for a field using the specified HTML name attribute. | |
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.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Visited | Determines whether the template has been visited by the user. |
Top
Remarks
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.