1 两个页面show.aspx与answer.aspx
现在要把show.aspx中的一个值传到answer.aspx中,并依新页面打开answer.aspx(固定大小)
则,在show.aspx下:
string s ="zhangzs";
Response.Write("<script>window.open('answer.aspx?str=" +s+ "' ,'_blank','width=620, height = 350' )</script>");
Response.Write("<script>window.open('answer.aspx?str=" +s+ "' ,'_blank','width=620, height = 350' )</script>");
在answer.aspx下:
Label1.Text="管理员"+Request.QueryString["str"]+"回复如下";
2 关闭answer.aspx页面并刷新原页面show.aspx:
则在answer.aspx页面:
Response.Write("<script>window.opener.location.replace('show.aspx');self.close();</script>");
Response.Write("<script>window.opener.location.replace('show.aspx');self.close();</script>");
如果只是单纯的关闭页面:
Response.Write("<script>window.close();</script>");