弹出一个警告框,在后退时不重新弹出。怎么做啊!!!本人原来是用alert做的每次后退时都重新弹出怎么办??
大家有什么新的技术说说,尽量“详细” 和  必要的“代码”!!!

解决方案 »

  1.   


    //在你弹出alert的页面中
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.AddHeader("Cache-Control", "no-cache");
            Response.AddHeader("Expires", "0");
            Response.AddHeader("pragma", "no-cache");
        }
      

  2.   

    既然弹出了 就不要考虑后退的时候触发。。你的需求是什么呢?
    Response.Write("<script>alert('XX!');window.location.href =\"本页.aspx\"</script>");这样行不。后退的时候给让他跳2次。才弹。
      

  3.   

    不明白楼主的需求是什么,如果一定要那样做,粗略想了一个法子,总共做三个页面:
    第一个页面存一个session["decstr"]="123"后location.href="第二个页面";
    第二个页面
    if(session["decstr"]!=null)
    {
    response.write("<script>alert('...');</script>");
    session["decstr"]=null;
    server.Transfer("第三个页面");
    }
    第三个页面session.Abandon();
    不知道这个办法行不行,请高手多多指教!