简体   繁体   English

将数据从页面传递到另一个页面的gridview内的文本框

[英]Passing data from a page to textbox inside a gridview in another page

Can anyone please help me with the following situation? 任何人都可以在以下情况下帮助我吗?

I've a default.aspx page in which I've 3 user controls. 我有一个default.aspx页面,其中有3个用户控件。 In one of the user control (say UC1.ascx), I have a gridview which has controls like hyperlink and textboxes. 在其中一个用户控件(例如UC1.ascx)中,我有一个gridview,其中包含超链接和文本框之类的控件。 On hyperlink click, I am opening another page in which I've another user control (say UC1.ascx) where some data is fetched from the database and displayed in a gridview. 单击超链接后,我将打开另一个页面,其中有另一个用户控件(例如UC1.ascx),在该控件中,一些数据是从数据库中提取的并显示在gridview中。 The user will select some of the data and on button save clicked, I am saving the data into a session variable as well as closing the page simultaneously. 用户将选择一些数据,并单击“保存”按钮,将数据保存到会话变量中,同时关闭页面。 My problem is on this button save clicked, I want to update whatever data the user selected to be posted back to the UC1.ascx and bound to the textbox. 我的问题是单击保存此按钮后,我想更新用户选择要发布回UC1.ascx并绑定到文本框的任何数据。

I'm not sure how to go about this in javascript. 我不确定如何在javascript中进行此操作。 Got suggestion to use ASP.NET Ajax update panel. 有建议使用ASP.NET Ajax更新面板。 I'm completely new to ASP.NET Ajax. 我对ASP.NET Ajax完全陌生。 So somebody please help with the Ajax approach. 因此,请提供Ajax方法的帮助。

The page you close will need to set a value in the original window via javascript assuming the original opened a new window/popup as listed below. 您关闭的页面将需要通过javascript在原始窗口中设置一个值,假设原始窗口打开了一个新窗口,如下所示。

However - have you thought about any other methods, such as ajax requests/update panels on the page to show other dynamic portions of data? 但是-您是否考虑过其他任何方法,例如页面上的ajax请求/更新面板以显示数据的其他动态部分?

See: http://www.codingforums.com/archive/index.php/t-61319.html 请参阅: http : //www.codingforums.com/archive/index.php/t-61319.html

specifially glenngv's post: 特别是glenngv的帖子:


function setColor(color){
if (opener && !opener.closed){
opener.document.theForm.theField.value = color;
opener.focus();
}
window.close();
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM