Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a C# Expert!

Join 244,307 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 791 people online right now. Registration is fast and FREE... Join Now!




CHILD WINDOW TO PARENT WINDOW TEXT BOX

 
Reply to this topicStart new topic

CHILD WINDOW TO PARENT WINDOW TEXT BOX, CHILD WINDOW TO PARENT WINDOW TEXT BOX

priyashe
5 Dec, 2008 - 01:51 AM
Post #1

D.I.C Head
**

Joined: 28 Aug, 2008
Posts: 74

can anyone help me to pass data from child window to parent window in c#

User is offlineProfile CardPM
+Quote Post


ThekillingGoku
RE: CHILD WINDOW TO PARENT WINDOW TEXT BOX
5 Dec, 2008 - 03:05 AM
Post #2

New D.I.C Head
*

Joined: 13 Nov, 2008
Posts: 19



Thanked: 1 times
My Contributions
So many possibilities, all dependent on your needs and situation.

Solutions range from thought out designs like a notification system (like the observer pattern for example) to quick fixes like saving your child instance in your parent and expose some public properties that the parent can then access. Even shared classes in a shared assembly can easily facilitate this, something like a singleton class which houses some shared variable cache.

Basically, there are plenty of possibilities, but it all depends on the situation what you want to use.
User is offlineProfile CardPM
+Quote Post

priyashe
RE: CHILD WINDOW TO PARENT WINDOW TEXT BOX
5 Dec, 2008 - 03:13 AM
Post #3

D.I.C Head
**

Joined: 28 Aug, 2008
Posts: 74

ya i'm having parent.aspx with textbox and button and child.aspx page with text box and button...while selecting parent.aspx page button it should transfer to child.aspx page and the datas we type in the child.aspx page should pass to parent.aspx text box ...plz explain me vit code
User is offlineProfile CardPM
+Quote Post

Jayman
RE: CHILD WINDOW TO PARENT WINDOW TEXT BOX
5 Dec, 2008 - 09:11 AM
Post #4

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 8,063



Thanked: 159 times
Dream Kudos: 500
Expert In: Everything

My Contributions
Use Session variables. Look here for information on Session variables.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: CHILD WINDOW TO PARENT WINDOW TEXT BOX
5 Dec, 2008 - 09:46 AM
Post #5

loves.Coding(this);
Group Icon

Joined: 26 Jul, 2007
Posts: 12,288



Thanked: 372 times
Dream Kudos: 10775
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

My Contributions
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
User is offlineProfile CardPM
+Quote Post

priyashe
RE: CHILD WINDOW TO PARENT WINDOW TEXT BOX
7 Dec, 2008 - 09:27 PM
Post #6

D.I.C Head
**

Joined: 28 Aug, 2008
Posts: 74

IN parent.aspx my code is
CODE

if (IsPostBack != true)
            {

                
          string str = @"<script>function get(elemValue)
{
document.getElementById('txtName').innerText=elemValue;

//document.write(string);

}
</script>";
                   Page.RegisterClientScriptBlock("get", str);
                    btnadd.Attributes.Add("onclick", "window.open('Child.aspx');");

}


In chi,d .aspx i have written like dis
CODE

if (!IsPostBack)
        {
            string scr = @"<script>function Sent()
{
var fName=document.getElementById('txtName').value;
window.opener.get(fName);
window.close();
} </script>;";
            //Page.RegisterStartupScript("Sent", scr);
            Page.RegisterClientScriptBlock("Sent", scr);
            btnAdd.Attributes.Add("onclick", "window.close();");



        }


In dis child page is opening but while typing datas in to the textbox did'nt return back to parent.aspx textbox...


plz do reply me
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 06:48PM

Live C# Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month