[英]How do I show the Alert Box first and then redirect to any page with query strings?
ScriptManager.RegisterStartupScript(UpdatePanel2, this.GetType(), "click", "alert('This Email address is already registered...');window.location.href ='test.aspx'", true);
By using the above code i able to show alert box and after that redirect to test.aspx page.通过使用上面的代码,我能够显示警告框,然后重定向到 test.aspx 页面。
But problem come when i have to pass query string with address like:但是当我必须传递带有地址的查询字符串时,问题就来了:
ScriptManager.RegisterStartupScript(UpdatePanel2, this.GetType(), "click", "alert('This Email address is already registered...');window.location.href ='test.aspx?WidgetID='" + Request.QueryString["WidgetID"] + "'&lan='" + readCookie() + "'&seeHome=true'", true);
thanks in advance提前致谢
your code has unnecessary (') s which breaks the string in javascript. Try this您的代码有不必要的 (') s,它会破坏 javascript 中的字符串。试试这个
ScriptManager.RegisterStartupScript(UpdatePanel2, this.GetType(), "click", "alert('This Email address is already registered...');window.location.href ='test.aspx?WidgetID=" + Request.QueryString["WidgetID"] + "&lan=" + readCookie() + "&seeHome=true'", true);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.