Click here to Skip to main content
15,885,869 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
i am able to get the selected value in textbox successfully which is on same page but, now I want that selected coloumn to be displayed in textbox of another page. Please help.


SQL
I think it is possible with the help of sessions.

now look i have two pages. On "page1.aspx" i have a button onclick grid pops up. that grid is on "page2.aspx"

it popup using iframes. Now what i want is to select particular column and that column should be displayed in textbox which is on page1.aspx
Posted
Updated 21-Jun-13 5:58am
v2
Comments
Mahesh Bailwal 21-Jun-13 9:24am    
Please elaborate what do you mean by another page. Do you mean another page in child window or you want to redirect to another page where you want to display the selected?
Asp_Learner 21-Jun-13 10:35am    
you querystring for that purpose ,but firstly you need to clear it out what exactly you want to do ,so that we can provide you a better solution
zain_mr89 21-Jun-13 11:57am    
I think it is possible with the help of sessions.

now look i have two pages. On "page1.aspx" i have a button onclick grid pops up. that grid is on "page2.aspx"

it popup using iframes. Now what i want is to select particular column and that column should be displayed in textbox which is on page1.aspx

1 solution

You can use JavaScript window.parent object to access iframe parent page. Below is sample for you reference.

Page1.aspx
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <iframe id="frame1" src='Page2.aspx' />
    </div>
    </form>
</body>
</html>


Page2.aspx
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server" onkeyup="SetParentValue()"></asp:TextBox>
    </div>
    </form>
    <script>
        function SetParentValue() {
             parent.document.getElementById("TextBox1").value = document.getElementById("TextBox1").value;
        }
    </script>
    
</body>
</html>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900