开发者

how can i redirect the page with AJAX?

开发者 https://www.devze.com 2022-12-13 11:52 出处:网络
I am using Infragistics control in my application. If the user get deleted from my application then i want to redirect that user to not authorize page. for redirection of the page i am using HttpConte

I am using Infragistics control in my application. If the user get deleted from my application then i want to redirect that user to not authorize page. for redirection of the page i am using HttpContext method but it's not working. I tried windows.location as well through java script but it's not working as well. Can somebody help me how to redirect page with AJ开发者_JAVA百科AX?

Thanks for your help in advance.


Are you consuming a button click event (or something similar) in your code behind?

If so Response.Redirect(url) will work as per a non-AJAX request?


If you are using Infragistics webAsyncRefreshPanel then you will need to create a literal control and add it to webAsyncRefreshPanel controls collection. Try below code.

           System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("<script language='javascript'>");
            sb.Append("window.location=notautorizepage.aspx")
             sb.Append("</script>");

            LiteralControl c = new LiteralControl(sb.ToString());
            webAsyncRefreshPanel.Controls.Add(c); 
0

精彩评论

暂无评论...
验证码 换一张
取 消