How do I access the ModelState from within my View (aspx page)?
Asked
Active
Viewed 3.2k times
121
1 Answers
189
-
21Also worthy to note that you can just do `ViewData.ModelState` and if you want to display some conditional markup on errors you can do like this: `@if (!ViewData.ModelState.IsValid)` – The Muffin Man Sep 15 '13 at 02:16
Your message was not sent. Please correct the errors below and try again.
Instead I want to do this:Your message was not sent. Please correct the errors below and try again.
– Saajid Ismail Jun 26 '09 at 13:44