如何维护来自子窗口的父窗口的文本框值 [英] How to maintain text box value of parent window coming from child window

查看:52
本文介绍了如何维护来自子窗口的父窗口的文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我在子aspx页面中使用window.opener方法,并从子aspx页面的网格视图中获取所选行的值到父aspx页面。我在父aspx页面的文本框中获得了价值,但是当我在子窗口中单击确定按钮时,我必须使用数据库表字段检查所选行值,并且需要在父窗口的文本框中显示相应的字段值,当我单击时父窗口中的保存按钮子窗口值在父窗口中消失



如何解决?你可以帮忙吗?

Hi i am using window.opener method in the child aspx page and getting value of the selected row from grid view of child aspx page to parent aspx page. i am getting value in textbox of parent aspx page but when i click ok button in the child window i have to check the selected row value with database table field and need to display the corresponding field value in textbox of parent window & when i click the Save button in parent window the child window value is disappearing in the parent window

How to Solve? can you Help?

推荐答案

使用属性怎么样?其他只是你可以起诉隐藏的字段......
What about using properties? Else simply you can sue hidden fields...


使用

ASP.NET Session [ ^ ]状态为用户存储和检索值



Cookies [ ^ ],因为cookie包含有关Web应用程序的信息,只要用户访问该站点就可以读取该信息,除非它被浏览器驱逐。
Use
ASP.NET Session[^] state to store and retrieve values for a user
or
Cookies[^], because a cookie contains information about the Web application which can be read whenever the user visits the site, unless it was destoyed by the browser.


您好Vivek

解决方案2是最好的。我只是举例说明如何使用会话。

Hi Vivek
Solution 2 is best . I am just giving you example how to use session.
Session["name"]=txt_name.text;





现在你可以访问你在整个项目的文本框中输入的任何名称。就像在你当前项目的任何页面上一样会话到期





now you can access anywhere name you entered in textbox throughout project .like this on any page of your current project until session expires

string name = Convert.ToString(Session["name"]);


这篇关于如何维护来自子窗口的父窗口的文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆