Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
For Method

ValidationHelper.For Method

Renders attributes that enable client-side validation for an individual user input element.

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

member For : 
        field:string -> HtmlString


Type: System.String
The name (value of the name attribute) of the user input element to validate.

Return Value

Type: System.Web.HtmlString
The attributes to render.

You call this method inside the markup of an individual user input element in order to enable client-side validation for that element. (You must also have previously included the required JavaScript libraries.) When the method is invoked, it renders the appropriate attributes so that the client-side validation routines can find and validate the content of the user input element.

© 2015 Microsoft