Return value to datagrid from Pop-up page  (

Posted on 2005-05-09
Last Modified: 2012-06-27
I am developing an application in
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.

Question by:TetraSA
    LVL 35

    Expert Comment

    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();")
    LVL 1

    Author Comment

    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 ??


    LVL 35

    Accepted Solution

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

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Suggested Solutions

    Preface In the first article: A Better Website Login System ( I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
    I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now