How do I access the ModelState from within my View (aspx page)?

Saajid Ismail picture Saajid Ismail · Jun 26, 2009 · Viewed 28.9k times · Source

How do I access the ModelState from within my View (aspx page)?

Answer

Mathias F picture Mathias F · Jun 26, 2009

Use ViewContext.ViewData.ModelState.