Click here to Skip to main content
15,886,003 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone tell me how to pass value from child page to parent page.I have a gridview on a parent page.Inside a gridview i have a textbox. In child page i have a textbox and a button. Now i want that when a value is entered in textbox in child page and button is clicked then this value needs to be shown in the textbox inside gridview in parent page. I am using C#


Thanks in advance
Posted
Comments
PhilLenoir 20-Aug-14 12:08pm    
What do mean "parent page" is it a Master Page Template or is it frames? Use Improve Question to add some more detail. In any case, I'd suggest using JavaScript on the client side and not use server side code.
Sergey Alexandrovich Kryukov 20-Aug-14 12:16pm    
Page of what? Is it ASP.NET? Then please add a tag: "ASP.NET". Use "Improve question".
—SA
Member 10987551 21-Aug-14 11:24am    
yes it is asp.net
Sergey Alexandrovich Kryukov 21-Aug-14 11:56am    
Did you pay attention that I suggested "Improve question"? You are the one the most interested in it, because the tag (like "C#3.5" you already put) should bring your post to the attention of the members competent in C# and ASP.NET even before this Web page is opened...
—SA

1 solution

In your Parent page, declare a a callback function:
JavaScript
function HandlePopupResult(result) {
    // Do what you want here
}


In your Child page, declare a function:
JavaScript
function SendValue(somevalues) {
    // Your logic here
    window.opener.HandlePopupResult(somevalues);
}


Just use the function SendValue on your button click event.

Happy coding!
 
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