在两个页面之间互相写其控件内的值
生活随笔
收集整理的這篇文章主要介紹了
在两个页面之间互相写其控件内的值
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
定義A頁面,定義TextBox id="TextBox1"和Button id="Button1"
后臺代碼:
????????{
????????????this.Button1.Attributes.Add("onclick","window.open('SelectData.aspx?rec=TextBox1','newwin','toolbar=no,menubar=no,status=no,location=no,resizable=no,scrollbars=no,width=218,height=185,top=190,left=300');return?false;");
????????}
定義界面B:? TextBox id="TextBox1"和Button id="Button1" 和type="hidden" id="name"
腳本:
????????????var?parwindow;
????????????parwindow=self.opener;
????????????var?recv?=?document.all("name").value;
????????????if?(parwindow?!=?null)?
????????????{
????????????document.all("TextBox1").value=parwindow.document.all(recv).value;
????????????}
????????????
????????????function?changetext()?
????????????{
????????????????if?(parwindow?!=?null)?
????????????????{
????????????????????try{
????????????????????????????parwindow.document.all(recv).value?=?document.all("TextBox1").value;
????????????????????????}
????????????????????catch(e)
????????????????????????{
????????????????????????}
?????????????????}
????????????}
????????</SCRIPT>
?
放在form后
后臺代碼:
????????{
????????????name.Value?=?Request.QueryString[0];
????????????this.Button1.Attributes.Add("onclick","changetext();window.close()");
????????}
?
?
?
?
?
轉載于:https://www.cnblogs.com/xh831213/archive/2006/02/16/331687.html
總結
以上是生活随笔為你收集整理的在两个页面之间互相写其控件内的值的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 第一集 企业IT体系结构
- 下一篇: “我太喜欢你了”——友情的表达方式?