redirect on Jquery Ajax success not working -


jquery code:

$.ajax({                     type: "post",                     async: false,                     cache: false,                     url: "manageusers/validatereportusers.aspx/allocatesessionredirect",                     data: '{id:"'+flag+'"}',                     contenttype: "application/json; charset=utf-8",                     datatype: "json",                     success: function (response) {                         if (response.d == true) {                             alert("you redirected.");                              window.location.href = "/downloadreport.aspx";                          }                     }                  });  web method code :   public static bool allocatesessionredirect (int id)          {              // set of codes here                return true;           } 

the browser displays alert message "you redirected." not execute window.location.href = "/downloadreport.aspx"; have tried window.location="/downloadreport.aspx"; window.location.assign("/downloadreport.aspx");

but did not work. please advice.

use location.assign("url"); instead. should work.

hope helps.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -