Here let's say I’ve received an Ajax request for a method that returns PartialView . By condition, this PartilView will have to completely replace the content in the element with such an id . And if during the processing of the Ajax-запроса on the server, I found that the request failed cheated on?
Of course, in some cases, you can simply return content by default (as with a normal request to the page), but in this case I will have to “guess” about the user's state, which is not very good.
PS Will a redirect to another Action work with an Ajax-запросе ? ( RedirectToAction("action","controller") ). Those. as if the browser just wanted to update the content, and here he is asked to go to a different address.

  • And what prevents to return an empty string, and in js to check what php returned? - KAGG Design
  • And in an amicable way, they return json, in which, besides the information itself, the status of the answer is also. - KAGG Design

0