为何datagrid生成超级连接会引发 onbeforeunload事件?
请各位help

解决方案 »

  1.   

    不是很明白你的意思?怎么会引发onbeforeunload事件呢?我用过好多次都没有出现这个问题啊。
      

  2.   

    你自己加超连接,会触发吗???
    datagrid生成的时候,有几个给你选择的吗,_self,_blank等
      

  3.   

    我在body中加入 onbeforeunload="closeit()";
    事件
    目的为了离开页面时。有个提示。
    但为点击连接列时就会提示
      

  4.   

    页面提交后会产生回送效果当然触发了onbeforeunload事件
      

  5.   

    invoke onbeforeunload's event:
    Close the current browser window. 
    Navigate to another location by entering a new address or selecting a Favorite. 
    Click the Back, Forward, Refresh, or Home button. 
    Click on an a that refers the browser to another Web page. 
    Invoke the a click method. 
    Invoke the document write method. 
    Invoke the document open method. 
    Invoke the document close method. 
    Invoke the window close method. 
    Invoke the window open method, providing the possible value _self for the window name. 
    Invoke the window navigate or NavigateAndFind method. 
    Invoke the location replace method. 
    Invoke the location reload method. 
    Specify a new value for the location href property. 
    Submit a form to the address specified in the action attribute via the input type=submit control, or invoke the form submit method.
      

  6.   

    每次postback  datagrid有一次onbeforeunload状态吧
    离开页面的提示你可以尝试用javascript写在页面里
    具体我javascript很菜,临时写不出代码
     类似于body里面的onload吧
      

  7.   

    对!会触发这个事件的!它的过程是:
    点击超连接->关闭本页->发送到服务器->生成新的页面->发送到客户端
      

  8.   

    我的页面分别是由toolbar,datagrid和一些服务器控件组成的。
    我想在未保存状态时,离开本页时出现一个是否离开提示窗口。
    如果大家有什么具体好的方法,请help me .
      

  9.   

    我的方法是在页面加载的时候在
    初使一个全局变量ISPostBack的值为false;
    _dopostback方法
    theform.submit();之前
    动态改变某一个全局变量的值为true;
    但不知为何datagrid 超级连接列
    <td><a href="javascript:_dopostback('datagrid1_..','')商品编码</a></td>
    就无法更改此全局变量,document.body.onbeforeunload()
    {
      if(!ISPostBack)
         event.returnvalue="是否要离开?";
    }
      

  10.   

    各位大哥可能误会了,datagrid的连接列,不是要打开新窗口,而是删除列,或历史列等。
      

  11.   

    document.body.onbeforeunload()
    {
      if(!ISPostBack)
         event.returnvalue="是否要离开?";
    }
      

  12.   

    你离开本页时肯定要响应一个事件嘛,在事件里面添加一段代码:
    Response.Write("<script language=javascript>if(!window.confirm('您尚未保存信息,是否离开?')){return;}</script>");
      

  13.   

    这个事件就是onbeforeunload
    问题某些连接列都会触发这个事件啊,如何区分》?