How do I access the ModelState from within my View

2019-03-08 05:40发布

问题:

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

回答1:

Use ViewContext.ViewData.ModelState.