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
Post a Comment