Calling Response.redirect through Ajax

后端 未结 2 1665
有刺的猬
有刺的猬 2020-12-11 05:02

I am making an Ajax request like this:

 $(\".box01 .selproduct\").live(\"click\", function(e) {
    var color = $(this).parent(\'.box01\').find(\'.color\').v         


        
2条回答
  •  半阙折子戏
    2020-12-11 05:03

    It is impossible to call Response.Redirect in WebMethod. Instead you can use

     success: function(data) {
         window.location.href="path.aspx";
            }
    

    in ajax Success function.

    If the page name is dynamic in nature return pagename from webmethod and use it to redirect the page.

提交回复
热议问题