PageModel.TryValidateModel Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
TryValidateModel(Object) |
Validates the specified |
TryValidateModel(Object, String) |
Validates the specified |
TryValidateModel(Object)
- Source:
- PageModel.cs
- Source:
- PageModel.cs
- Source:
- PageModel.cs
Validates the specified model
instance.
public:
virtual bool TryValidateModel(System::Object ^ model);
public virtual bool TryValidateModel (object model);
abstract member TryValidateModel : obj -> bool
override this.TryValidateModel : obj -> bool
Public Overridable Function TryValidateModel (model As Object) As Boolean
Parameters
- model
- Object
The model to validate.
Returns
true
if the ModelState is valid; false
otherwise.
Applies to
TryValidateModel(Object, String)
- Source:
- PageModel.cs
- Source:
- PageModel.cs
- Source:
- PageModel.cs
Validates the specified model
instance.
public:
virtual bool TryValidateModel(System::Object ^ model, System::String ^ name);
public virtual bool TryValidateModel (object model, string name);
public virtual bool TryValidateModel (object model, string? name);
abstract member TryValidateModel : obj * string -> bool
override this.TryValidateModel : obj * string -> bool
Public Overridable Function TryValidateModel (model As Object, name As String) As Boolean
Parameters
- model
- Object
The model to validate.
- name
- String
The key to use when looking up information in ModelState.
Returns
true
if the ModelState is valid;false
otherwise.