Does not return value pro javascript

3

I'm having a problem that the value coming from my controller does not come back to javascript.

I'll explain what happens:

I send requests via ajax to my controller and it is waiting for the return of values, while there is no return value my ajax is waiting, then when it has the return value it displays in my modal, until then I'm on the page that I open the modal works cool with no problem, but if I refresh the screen (F5) or change the page (view) the value that is waiting in the controller does not arrive in ajax anymore. But in the controller it processes all the information as it is to be displayed in the modal.

ajax

$.ajax({
        type: 'post',
        url: urlW,
        success: function (data) {

}

controller

AnalistaBean a = new AnalistaBean();
a = atendeBussines.ReceiveCTI((Socket)Session["ConexaoCTI"]);
return Json(new { r = a });

But it just stops sending the pro ajax request when I do the F5 or page mute

    
asked by anonymous 22.08.2014 / 17:20

1 answer

1

Simply add a hidden field in your view that gets the value of your request coming from the control and it will persist. To get and send the request again, you only have to javascript the value of this input.

    
23.09.2014 / 15:06