I have a method which will return JsonResult or RedirectToRouteResult based on some conditions in my asp.net mvc (C#) application.
The RulesException can be shown in <%= Html.ValidationSummary()%>, if i use return RedirectToAction(.....).
How can i show the rules excep开发者_如何转开发tions in ValidationSummary when i return it as JsonResult?
I'm not really sure if this is going to fit your needs and it is not direct answer to your question, but version 1.0 of xVal has support for client side validation summaries. Maybe this way you don't have to bother if result is JSON...
    <div id="validationSummary">
    <%= Html.ValidationSummary("Please fix the following problems:") %>
    </div>
and..
<%= Html.ClientSideValidation("booking", typeof(Booking))
    .UseValidationSummary("validationSummary") %>
Here you can read more about it.
Hope this was helpfull, regards.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论