Export (0) Print
Expand All

HtmlHelper.GetUnobtrusiveValidationAttributes Method (String, ModelMetadata)

Gets the collection of unobtrusive JavaScript validation attributes using the specified HTML name attribute and model metadata.

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

public IDictionary<string, Object> GetUnobtrusiveValidationAttributes(
	string name,
	ModelMetadata metadata


Type: System.String
The HTML name attribute.
Type: System.Web.Mvc.ModelMetadata
The model metadata.

Return Value

Type: System.Collections.Generic.IDictionary<String, Object>
The collection of unobtrusive JavaScript validation attributes.

Caution noteCaution

On the first call, a collection of attributes is returned. Further calls (on the same field) return an empty collection.

© 2014 Microsoft