ValidationExtensions.Validate Method (HtmlHelper, String)
Retrieves the validation metadata for the specified model and applies each rule to the data field.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
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.
Show: