• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

Return value to datagrid from Pop-up page (ASP.net)

Hi,
I am developing an application in ASP.net
I have a datagrid that is being used for data entry. I have a column called "Product". While adding a row , I want to allow the user to click on a button in the datagrid row which will pop-up a page that will have a list of all the available products(listed in a datagrid). He will select a product from the list.
What I want to know is how do I get this selected value back into a textbox in the datagrid in the parent form.
I can get the selected value in a session variable , but in the parent form how do assign this value to the texbox.

Note that the datagrid will multiple rows. How can I find the name of the textbox to which to return the value to.


Thanks
0
TetraSA
Asked:
TetraSA
  • 2
1 Solution
 
YZlatCommented:
put a button on your pop-up window and call it btnClose. Then put the following line in the code-behind file for a pop-up window:

btnClose.Attributes.Add("onclick", "javascript:window.opener.Form1.TextBox1.value=MyValue;self.close();")
0
 
TetraSAAuthor Commented:
Hi,
But how will I know that the name of the source textbox is Textbox1? Coz the textbox is in the datagrid, and the textbox will get its name(html name) when that  specific row is rendered.
Or have I misunderstood the whole thing ??

Thanks



0
 
YZlatCommented:
open your page in HTML view, find your textbox in the html code and get its name
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now