protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write("<script>window.open('http://www.baidu.com');</script>");
    }
先这样测试下

解决方案 »

  1.   

    window.open('http://www.baidu.com','');
      

  2.   


    http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.hyperlink.imageurl(v=vs.100).aspx
      

  3.   


    我想在跳转页面的时候传值,于是我是这么做的,可是报错了,说在将 nvarchar 值 '<%=GetUserId() %>' 转换成数据类型 int 时失败。这是什么原因呢?
    <asp:HyperLink id="hyperlink1" Target="_new" ImageUrl="/Avatar/1.jpg" runat="server" Height="150" Width="150" NavigateUrl='Friendsweb.aspx?userid=<%=GetUserId() %>'/> protected int GetUserId()
            {
                return Convert.ToInt32(ViewState["UserId0"]);
            }
      

  4.   

    Response.Redirect("新页面路径。");
      

  5.   


    '<%=GetUserId() %>' 是什么类型的,人家不是提示的很明白了吗:“说在将 nvarchar 值 '<%=GetUserId() %>' 转换成数据类型 int 时失败” 说明你哪个'<%=GetUserId() %>为无法转换的nvarchar类型
      

  6.   

    既然报错的错误信息是将 nvarchar 值 '<%=GetUserId() %>' 转换成数据类型 int 时失败
    你可以调试一下看看GetUserId返回的是个什么样的值,为什么转换不成int类型
      

  7.   


        protected void IbgBtn_Click(object sender, ImageClickEventArgs e)
        {
            Response.Write("<script>window.open('http://music.baidu.com');</script>");
        }