Validate Method
Collapse the table of content
Expand the table of content

ValidationExtensions.Validate Method (HtmlHelper, String)

 

Retrieves the validation metadata for the specified model and applies each rule to the data field.

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

public static void Validate(
	this HtmlHelper htmlHelper,
	string modelName
)

Parameters

htmlHelper
Type: System.Web.Mvc.HtmlHelper

The HTML helper instance that this method extends.

modelName
Type: System.String

The name of the property or model object that is being validated.

Exception Condition
ArgumentNullException

The modelName parameter is null.

Client validation must be enabled.

Return to top
Show:
© 2016 Microsoft