Click here to Skip to main content
15,915,160 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi guys,

I have to ASPX pages A.aspx and B.Aspx. A.aspx has mail sending functionality [To,Cc,Subject and SendButton] To and CC are hyperlinks and also we have To and CC textboxes, the links will open a popup which has email ids with checkboxes loaded in radgrid. I'm trying to send the selected mailids to A.aspx page textbox from code behind of popup[B.aspx].
I'm using Page.ClientScript.RegisterStartupScript to call javascript of popup which in turn sets the value of A.aspx.But its not working.So please tell me which is the best way to achieve this.

Thanks
Posted
Updated 22-Apr-14 18:48pm
v2
Comments
Bh@gyesh 23-Apr-14 0:36am    
Please refer following link.

http://p2p.wrox.com/general-net/18997-get-popup-window-value-without-refresh.html

1 solution

First of all, it's rarely a good practice to open a popup window. This is not inherently bad, but many users try to fight against annoying popup ads and will block popups using some popular browser plugin developed for such purposes.

But your problem is quite solvable. The thing is: a popup window and its parent are not independent; a popup window remembers it parent and can manipulate it in Javascript. The key to the solution is this:
http://www.w3schools.com/jsref/prop_win_opener.asp[^].

The simple sample on the page referenced above shows how can you use it.

[EDIT]

Also, you can use window.parent: http://www.w3schools.com/jsref/prop_win_parent.asp[^].

—SA
 
Share this answer
 
v2
Comments
Sagar Devanahalli 23-Apr-14 2:25am    
Thanks a lot Sergey it worked..
Sergey Alexandrovich Kryukov 23-Apr-14 9:53am    
My pleasure.
Good luck, call again,
—SA

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