Share via


ValidationExtensions.Validate(HtmlHelper, String) Method

Definition

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

public static void Validate (this System.Web.Mvc.HtmlHelper htmlHelper, string modelName);
static member Validate : System.Web.Mvc.HtmlHelper * string -> unit
<Extension()>
Public Sub Validate (htmlHelper As HtmlHelper, modelName As String)

Parameters

htmlHelper
HtmlHelper

The HTML helper instance that this method extends.

modelName
String

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

Exceptions

The modelName parameter is null.

Applies to