Class TemplateInfo
Encapsulates information about the current template context.
public class TemplateInfo
- Inheritance
-
TemplateInfo
- Inherited Members
Constructors
TemplateInfo()
Initializes a new instance of the TemplateInfo class.
public TemplateInfo()
Properties
FormattedModelValue
Gets or sets the formatted model value.
public object FormattedModelValue { get; set; }
Property Value
- object
The formatted model value.
HtmlFieldPrefix
Gets or sets the HTML field prefix.
public string HtmlFieldPrefix { get; set; }
Property Value
- string
The HTML field prefix.
TemplateDepth
Contains the number of objects that were visited by the user.
public int TemplateDepth { get; }
Property Value
- int
The number of objects.
Methods
GetFullHtmlFieldId(string)
Retrieves the full DOM ID of a field using the specified HTML name attribute.
public string GetFullHtmlFieldId(string partialFieldName)
Parameters
partialFieldNamestringThe value of the HTML name attribute.
Returns
- string
The full DOM ID.
GetFullHtmlFieldName(string)
Retrieves the fully qualified name (including a prefix) for a field using the specified HTML name attribute.
public string GetFullHtmlFieldName(string partialFieldName)
Parameters
partialFieldNamestringThe value of the HTML name attribute.
Returns
- string
The prefixed name of the field.
Visited(ModelMetadata)
Determines whether the template has been visited by the user.
public bool Visited(ModelMetadata metadata)
Parameters
metadataModelMetadataAn object that encapsulates information that describes the model.
Returns
- bool
true if the template has been visited by the user; otherwise, false.