You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 27, 2020. It is now read-only.
Trevor Pilley edited this page Jan 5, 2015
·
1 revision
The ValidateModelStateAttribute validates the model state in a request and redirects to the view if it is invalid, it saves having to wrap all your methods with if (ModelState.IsValid()).
There are times when you may want to return a different model to the view than the one posted to the action so it is easy to opt out an action:
[ValidateModelState(SkipValidation = true)] // will only affect the action it is applied to
public ActionResult Edit(int id, Model model) { ... }