如果允许,在UpdatePanel中使用iframe即可,不允许的话,用下面的方法实现弹窗

要在UpdatePanel中使用FileUpload时,会遇到此问题,或者同类其它情况

 

<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
          <ContentTemplate>
              <asp:Button ID="Button1" runat="server" Text="弹出" onclick="Button1_Click" />
          </ContentTemplate>
        </asp:UpdatePanel>

 

后台代码:

protected void Button1_Click(object sender, EventArgs e)
    {
        string script = "window.open('test.aspx','newwindow','height=400,width=700,menubar=no')";
        ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "click", script, true);
    }

posted on 2014-01-15 16:24  御不凡  阅读(293)  评论(0编辑  收藏  举报