Export (0) Print
Expand All

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)

public function For(
	field : String
) : HtmlString

Parameters

field
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.

Show:
© 2014 Microsoft