none
为什么ScriptManager.RegisterStartupScript 后面跟return 或者Response.Redirect语句就无法执行 RRS feed

  • 问题

  • ScriptManager.RegisterStartupScript(UpdatePanel, typeof(UpdatePanel), "confirm", "window.alert('成功!')", true);

    Response.Redirect("xxx.aspx");

    提示框始终无法显示,请高手回答?

     

    2011年8月4日 8:04

答案

全部回复

  • 因為在顯示alert前,就被瀏覽器導到xxx.aspx了,所以看不到成功的訊息。
    以上說明若有錯誤請指教,謝謝。
    http://www.dotblogs.com.tw/terrychuang/
    2011年8月4日 8:08
  • 能不能说的详细点?

    另外,如果想alert点击确定后转到xxx.aspx,该怎么写呢?

    2011年8月4日 8:12
  • 能不能说的详细点?

    另外,如果想alert点击确定后转到xxx.aspx,该怎么写呢?


    ScriptManager.RegisterStartupScript(UpdatePanel, typeof(UpdatePanel), "confirm", "alert('成功!');location.href='xxx.aspx'", true);
    


    Shadowと愉快なコード達
    Please correct me if my concept is wrong
    2011年8月4日 8:56