Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.

 

ModelState Error Messages cleared by rendering content area?

Vote:
 

Hi, I'm still investigating this but when I have errors in my ModelState, they appear to be lost after rendering a content area.

Walking though a debugger after a form submission, the modelstate has an invalid property "Category" with an error from a required attribute of "The Category field is required." (watch on ModelState["Category"].Errors[0].ErrorMessage)

I stepped past @Html.PropertyFor(m => m.CurrentPage.ContentArea) before my form with a single content block containing only one XhtmlString property. After that the ModelState still has the "Category" property marked invalid, but the Errors collection is now empty.

Any ideas?

#297867
Mar 07, 2023 16:47
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.