943,095 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Marked Solved
  • Views: 2056
  • ASP.NET RSS
Apr 6th, 2010
0

pass variables from popup asp page to parent aspx page

Expand Post »
Quote ...
I have a form with textbox. Besides this textbox i should have imagebutton / something which on clicking will open a popup window (lookup). This popup window will have UserId and Usernames (from db). So when the User selects one from this , the UserId should get selected in the textbox. How to do this? Please help. Can you please send me a sample of this type ..? Its very urgent.
Thanks lot..
Quote ...
i use the following code but its not working
Quote ...
to open popup
ASP.NET Syntax (Toggle Plain Text)
  1. string servicename = ((Button)sender).Text.ToString();
  2. string url = "Postcode.aspx?Websevice=" + servicename;
  3. ScriptManager.RegisterClientScriptBlock(this, this.GetType(),"str", "<script language='javascript'>window.open('" + url + "','height=auto,width=1000,scrollbars=1,top=250,right=20');</script>", false);
Quote ...
this will fine open new user window
Quote ...
now i set selected variable of user list in parent page
ASP.NET Syntax (Toggle Plain Text)
  1. string id = ViewState["Id"].ToString();
  2. string textid = "textbox5";
  3. ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "str", "<script language='javascript'>window.opener.document.getElementById('" + textid + "').value ='" + id + "'; window.close();</script>", false);
Quote ...
here id is selected value and text id is parent page textbox id in which i want to pass value.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bhavu4u is offline Offline
12 posts
since Mar 2010
Apr 6th, 2010
0
Re: pass variables from popup asp page to parent aspx page
Use window.opener javascript method.
Moderator
Reputation Points: 2134
Solved Threads: 1227
Posting Genius
adatapost is offline Offline
6,524 posts
since Oct 2008
Apr 7th, 2010
0
Re: pass variables from popup asp page to parent aspx page
I already used it in my code see my code but i can't get value can u give me a working example. Thanks a lot for reply
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bhavu4u is offline Offline
12 posts
since Mar 2010
Apr 7th, 2010
0
Re: pass variables from popup asp page to parent aspx page
Moderator
Reputation Points: 2134
Solved Threads: 1227
Posting Genius
adatapost is offline Offline
6,524 posts
since Oct 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Update Panel with Web Control & uploadFile
Next Thread in ASP.NET Forum Timeline: export database to excel





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC