主页面 'aaa.aspx'。 datalist 里面
<asp:LinkButton ID="LinkButton2" runat="server" CommandName="selectnr">查看</asp:LinkButton>
后台代码
if (e.CommandName == "selectnr")
{
Session["hy_id"] = int.Parse(datalist.DataKeys[e.Item.ItemIndex].ToString());
Response.Write("<script>javascript:window.open('bbbb.aspx','newwindow', 'height=500, width=400')</script>");
}
弹出的窗口 'bbbb.aspx'
后台代码
protected void Button1_Click(object sender, EventArgs e)
{
//修改内容
Response.Write("<script>alert('提交成功!');window.opener.document.location='aaa.aspx';window.close();</script>"); //history.back()
}