Showing server-side validation in ASP.NET MVC in jQuery modal dialog
When using a jQuery modal dialog in asp.net mvc3. How would you redisplay the dialog after posting to the ActionResult and redisplaying serverside vali开发者_如何学Pythondation errors. In otherwords I would like to know how to display serverside errors in the modal dialog. Or redisplay the modal with server side validation errors after post.
Thanks in advance.
With regard re-displaying the dialog; don't. Leave it open and close it in an onsuccess handler from your (presumably) Ajax form. I suggest using a PartialView for the content of your dialog.
You can render the errors in your dialog by using Html.ValidationSummary()
.
精彩评论