我点击A页面上一个按钮事件,弹出一个新页面窗口,然后在点击新页面窗口的提交按钮!我希望能提交成功,并且关闭新窗口页面,然后刷新下之前的A页面!窗口页面的后台代码Response.Write("<script>alert('Excle表导入成功!');</script>");

解决方案 »

  1.   

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>A也面</title>
        <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
        <script type="text/javascript">
           function WOpen(){
            window.open("Default2.aspx");
           }
        </script>
    </head>
    <body>
        <form runat="server">
        <a onclick="WOpen()">打开</a>
        <%=DateTime.Now.ToString() %>
        </form>
    </body>
    </html><html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>B页面</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <input id="Text1" name="Text1" type="text" />
            <input id="Submit1" type="submit" value="submit" />
        </div>
        </form>
    </body>
    </html>        if (Request.Form["Text1"] != null)
            {
                //插入
                Response.Write("<script>window.close();window.opener.location.href=window.opener.location.href</script>");
            }
      

  2.   

    第一页:protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Write("<script>window.open('default2.aspx')</script>");
        }
    第二页:
            Response.Write("<script>alert('提交成功');window.opener.location.href=window.opener.location.href;window.close()</script>");