Ajax Call Validation Summary

What is the best way to send back Checking results back to the client when calling ajax using jquery?

+3
source share
2 answers

An easy way to achieve this is to have a div inside your page containing a partial one with a validation summary. When you invoke a controller action using AJAX, it returns this partial, and you can update the summary. Example:

$('#validationSummary').load('/home/someaction');

where the action will return the view:

public ActionResult SomeAction()
{
    return View();
}

and corresponding view:

<%= Html.ValidationSummary() %>

, HTML, / . JSON, JSON , , AJAX DOM. , , jQuery Templates, : -)

+3
0

Source: https://habr.com/ru/post/1786270/


All Articles