2012-04-10 17 views
0
ScriptManager.RegisterStartupScript(UpdatePanel2, this.GetType(), "click", "alert('This Email address is already registered...');window.location.href ='test.aspx'", true); 

通過使用上面的代碼,我能夠顯示警報框,然後重定向到test.aspx頁面。如何首先顯示警報框,然後使用查詢字符串重定向到任何頁面?

但是問題來了,當我不得不與像轉交地址查詢字符串:

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); 

在此先感謝

回答

0

您的代碼不必要(') 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); 
+0

謝謝Ozgur kara我也解決了它:-)。 – Sunny 2012-04-10 06:48:16

相關問題