在主界面中(webform1.aspx)弹出模式页面(webform2.aspx)并向(webform2.aspx)的textbox控件赋值。
(1)、在webform1.aspx的button中写
Page.RegisterStartupScript("","<script>var a=new Array(document.all.TextBox1,document.all.TextBox2); window.showModalDialog('WebForm2.aspx',a,'');</script>");
(2)、在webform2.aspx的page_load中写
Page.RegisterStartupScript("","<script>var a=window.dialogArguments;document.all.TextBox1.value=a[0].value;document.all.TextBox2.value=a[1].value;</script>");