ModelStateDictionary.AddError Method

Adds an error message to the model state that is associated with the specified key.

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

Syntax

'Declaration
Public Sub AddError ( _
    key As String, _
    errorMessage As String _
)
'Usage
Dim instance As ModelStateDictionary 
Dim key As String 
Dim errorMessage As String

instance.AddError(key, errorMessage)
public void AddError(
    string key,
    string errorMessage
)
public:
void AddError(
    String^ key, 
    String^ errorMessage
)
member AddError : 
        key:string * 
        errorMessage:string -> unit
public function AddError(
    key : String, 
    errorMessage : String
)

Parameters

  • key
    Type: System.String
    The key that is associated with the model state that the error message is added to.

See Also

Reference

ModelStateDictionary Class

System.Web.WebPages.Html Namespace