页面面见传值

 

1. Show 模态窗口

---主界面   //显示      <asp:Label ID="lblInstrumentType" runat="server" Text="Edit Instrument Type"  ></asp:Label>          //打开子窗口 <input id="Button5" type="button" value="Edit Instrument Type" onclick="onEditInstrumentType()" />

    <script type="text/javascript">

        function onEditInstrumentType() {             var res = window.showModalDialog('Maintainance/EditInstrumentType.aspx?t=' + Date(), 'SelectCompany');                         $('#lblInstrumentType').html(res == '' ? 'N/A' : res);         }     </script>

---次界面

cs 中         protected void BtnUpdate_Click(object sender, EventArgs e)         {             this.RegisterStartupScript("", string.Format("<script>window.returnValue = '{0}'; window.close();</script>", ShowInstrumentInfor(true)));         }

       ShowInstrumentInfor(true) 返回要返回的值, 也可以在page 页面处理

 

2. 普通的界面 直接使用Window.opener 进行取值。

 

posted @ 2016-06-23 18:13  光阴的故事-SKY  阅读(73)  评论(0编辑  收藏  举报