ModelClientValidationRule.ValidationParameters Property

Visual Studio 2010

Gets the list of validation parameters.

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

'Declaration
Public ReadOnly Property ValidationParameters As IDictionary(Of String, Object)
	Get

Property Value

Type: System.Collections.Generic.IDictionary(Of String, Object)
A list of validation parameters.

The following example shows how the ModelClientValidationRegexRule constructor sets the error message and validation type, and how it adds a regular expression rule.

Public Class ModelClientValidationRegexRule 
    Inherits ModelClientValidationRule 
    Public Sub New(ByVal errMessage As String, ByVal pattern As String) 
        ErrorMessage = errMessage 
        ValidationType = "regularExpression" 
        ValidationParameters.Add("pattern", pattern) 
    End Sub 
End Class

Community Additions

ADD
Show: