2012-04-10 10 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

あなたのコードは、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

おかげでオズガールカラ私もそれを解決しました:-)。 – Sunny