我在页面main.aspx中用了一个用户控件search.asx,在该用户控件中含有一个按钮,我希望在点击该按钮后弹出一个新页面,而不是在原来的main中Redirect,怎么做?我用了javascript可是不行,不弹出来。

解决方案 »

  1.   

    偶没用过用户控件?form里面加上target="_blank"
    或者使用JS showModalDialog() /window.open()
      

  2.   

    <form id="form1"...... target="_blank">
    Response.Redirect("aaa.apx");就可以打开新页面。
    ---------------------------------------------------------------------
    或者
    <form id="form1"...... target="_blank" action="aaa.aspx">
      

  3.   

    Response.Write("<script>window.open();</script>");
      

  4.   

    private void Button1_Click(object sender, System.EventArgs e)
    {
    this.Page.RegisterStartupScript("open","<script>window.open('WebForm4.aspx');</script>");
    }
      

  5.   

    弹出窗口:
    this.Label.Text = "<a onclick=window.open('"+index.aspx?ContactNo="+a.ToString()+"','popuppage','width=400,height=380,top=130,left=200,scrollbars,resizable')  style='CURSOR: hand'>"+e.Item.Cells[2].Text.ToString()+"</a>";
      

  6.   

    用户控件里加form target = “_blank”,我试的好像不行,不能生成新页面,xiaohuasz的方法有效,呵呵,多谢大家