当用户点击控件时,HyperLink控件会立即将用户“导航”到目标URL,表件不会回送到服务器上。LinkButton控件则首先将表件发回到服务器,然后将用户导航到目标URL。如果在“到达”目标URL之前需要进行服务器端处理,则使用LinkButton控件;如果无需进行服务器端处理,则可以使用HyperLink控件。 
我想先发回到服务器,再导航到目标URL
但是用 LinkButton 没有target。
用HyperLink又 不到服务器 直接导航过去了,这种情况如何解决呢。

解决方案 »

  1.   

    可以在LinkButton 按钮事件里面写转向方法。
      

  2.   


    但是LinkButton里面没有 Target 。
    而且那种 跳转有些浏览器会屏蔽。
    我的Target想设置为"_blank"
      

  3.   

    可以在LinkButton 按钮事件里面写下面的这种
    ClientScriptManager cs = Page.ClientScript;
    String csname1 = "PopupScript";
    Type cstype = this.GetType();
     
    if (!cs.IsStartupScriptRegistered(cstype, csname1))
    {
       String cstext1 = "window.open('information_change.aspx','_blank')";
       cs.RegisterStartupScript(cstype, csname1, cstext1, true);
    }
      

  4.   

    Page.RegisterStartupScript( this.GetType(),"starup", "<script language = 'javascript'>"window.open('information_change.aspx','_blank')";</script>")
    可以用一句话。
      

  5.   

    直接一个button判断后response.Redict("http://url");