Share via


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)

Syntax

'Declaration
Public Function For ( _
    field As String _
) As HtmlString
'Usage
Dim instance As ValidationHelper 
Dim field As String 
Dim returnValue As HtmlString 

returnValue = instance.For(field)
public HtmlString For(
    string field
)
public:
HtmlString^ For(
    String^ field
)
member For : 
        field:string -> HtmlString
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.

Remarks

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.

See Also

Reference

ValidationHelper Class

System.Web.WebPages Namespace