S
S
Sneiksus2019-08-16 14:27:47
JavaScript
Sneiksus, 2019-08-16 14:27:47

How to process the received View in js?

function A() {
              
                    $.get("/Home/B", {
                        "Email": document.getElementById("Email").value,
                        "Password": document.getElementById("Pass").value   },
                     function (data) {
                     //  ......
                     });


[HttpGet]
        public ActionResult B(string Email, string Password)
        {
           //some code

            return View();
        }


The request is sent and executed successfully. The controller returns a view. How in the success get function of the request, accept and display the received View?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
ettychel, 2019-08-20
@ettychel

Try it, maybe your solution
Make some empty block on the page where you plan to insert
In success, if you get ready html write it like this

success :  function (data) {
                     $('div#input_ajax').html(data)
                     })

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question