Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I have a grid view in the parent page with text boxes. when i click on grid view text boxes child page window opens where i am selecting values from child grid view. I like to pass that value to parent grid view respective text boxes.
How can i achieve this.Kindly give me a suggestion?
Posted
Comments
j snooze 9-Oct-14 17:40pm    
you can access parent page objects(functions etc...) through javascript using the window.opener object.
VC.J 10-Oct-14 1:05am    
you can do one thing in parent page you can put a hidden field and access that hidden field in child page and assign the value of text box to the hidden field and than assign the value
Gopinath C 10-Oct-14 1:09am    
Thanks @VC.J , Can you show me any sample example for this hidden field. Am a kind of beginner

Gopi for that you have two ways :
from code behind :
C#
var parentControl =(HiddenField) Parent.FindControl("ControlID");
            parentControl.Value = txtBox.Text;



from javascript

C#
function assingValue() {
             parent_window.document.getElementById('hdnFieldValue').value = document.getElementById('txtbox').value;
         }
 
Share this answer
 
There are so many ways you can achieve this. You can take one of them according to your requirement. Please read here.

http://msdn.microsoft.com/en-us/library/vstudio/6c3yckfw(v=vs.100).aspx[^]

http://www.codeguru.com/columns/dotnet/passing-data-between-pages-in-asp.net.htm[^]

Please accept/up vote if it helps you.

Thanks
 
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