<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Client Side Web Development</title><link>http://forums.asp.net/130.aspx</link><description>Client-side programming discussions, including CSS, DHTML, JScript/Javascript, etc. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=18&amp;c=16" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/3045276.aspx</link><pubDate>Sat, 28 Mar 2009 17:44:32 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3045276</guid><dc:creator>nikhil20980</dc:creator><author>nikhil20980</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3045276.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3045276</wfw:commentRss><description>&lt;p&gt;The problem was basically not even what I mentioned earlier. I was trying to store the values in a TextBox.text field in the login_click method and somehow that was not working out.&lt;/p&gt;&lt;p&gt;Tried to pass the values as a parameter to the CloseDialog() method resolved the issue for me.&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/3044988.aspx</link><pubDate>Sat, 28 Mar 2009 14:09:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3044988</guid><dc:creator>nikhil20980</dc:creator><author>nikhil20980</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3044988.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3044988</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Got it. I was using an &amp;lt;asp:Button&amp;gt; where as your sample has &amp;lt;input type=&amp;quot;Button&amp;quot;&amp;gt;. Using the &amp;lt;Input&amp;gt; tag resolved the problem.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;But now i have another problem. The asp:Button that i was using had additional actions before calling the CloseDialog() function. It was working with the DB to get some information and storing them to variables.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I would have to find some other way to accomplish that. Any ways to achieve that here?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/3040260.aspx</link><pubDate>Thu, 26 Mar 2009 14:23:59 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3040260</guid><dc:creator>NC01</dc:creator><author>NC01</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3040260.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3040260</wfw:commentRss><description>&lt;p&gt;The example that I posted was tested and works witout errors. It will only work in Internet Explorer however, since it uses window.showModalDialog and window.returnValue.&lt;/p&gt;
&lt;p&gt;NC...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/3040193.aspx</link><pubDate>Thu, 26 Mar 2009 13:59:08 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3040193</guid><dc:creator>nikhil20980</dc:creator><author>nikhil20980</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3040193.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3040193</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I get object required error now. &lt;/p&gt;&lt;p&gt;Also i could not find a window.returnValue. &lt;img src="http://forums.asp.net/emoticons/emotion-10.gif" alt="Embarrassed" /&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/3040021.aspx</link><pubDate>Thu, 26 Mar 2009 13:02:47 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3040021</guid><dc:creator>NC01</dc:creator><author>NC01</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3040021.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3040021</wfw:commentRss><description>&lt;p&gt;The window.opener does NOT work if you use window.showModalDialog to open the window. Read the previous posts in this thread. Here&amp;#39;s an example of what you need to do:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Parent.aspx:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;form id=&amp;quot;Form1&amp;quot; method=&amp;quot;post&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;input type=&amp;quot;button&amp;quot; onclick=&amp;quot;openDialog();&amp;quot; value=&amp;quot;Open&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function openDialog()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;var dialogFeatures = &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;#39;dialogHeight: 600px; dialogWidth: 800px; help: no; center: yes; resizable: no; scroll: no; &amp;#39; +&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;#39;edge: sunken; &amp;#39; + // raised&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;#39;status: no; &amp;#39; +&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;#39;unadorned: yes; &amp;#39;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;// The status and unadorned properties only work when the dialog is opened from a trusted application&lt;br /&gt;&amp;nbsp;var dialogReturn = window.showModalDialog(&amp;#39;Dialog.aspx&amp;#39;, null, dialogFeatures);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;if ( !dialogReturn )&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;// Dialog closed by the &amp;quot;X&amp;quot; closer or no value sent...&lt;br /&gt;&amp;nbsp;&amp;nbsp;alert(&amp;#39;NO return from dialog&amp;#39;);&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;//alert(&amp;#39;Return from dialog: &amp;#39; + dialogReturn);&lt;br /&gt;&amp;nbsp;&amp;nbsp;__doPostBack(&amp;#39;ReturnFromDialogPostBack&amp;#39;, dialogReturn);&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Parent.aspx.cs:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;private void Page_Load(object sender, System.EventArgs e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;// Insure that the __doPostBack() JavaScript method is created...&lt;br /&gt;&amp;nbsp;this.GetPostBackEventReference(this, string.Empty);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;if ( this.IsPostBack )&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;string eventTarget = (this.Request[&amp;quot;__EVENTTARGET&amp;quot;] == null) ? string.Empty : this.Request[&amp;quot;__EVENTTARGET&amp;quot;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;string eventArgument = (this.Request[&amp;quot;__EVENTARGUMENT&amp;quot;] == null) ? string.Empty : this.Request[&amp;quot;__EVENTARGUMENT&amp;quot;];&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;if ( eventTarget == &amp;quot;ReturnFromDialogPostBack&amp;quot; )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.Session[&amp;quot;TestSessionObject&amp;quot;] = eventArgument;&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;string testSessionObject = (this.Session[&amp;quot;TestSessionObject&amp;quot;] == null) ? string.Empty : this.Session[&amp;quot;TestSessionObject&amp;quot;].ToString();&lt;br /&gt;&amp;nbsp;this.Response.Write(&amp;quot;TestSessionObject: [&amp;quot; + testSessionObject + &amp;quot;]&amp;lt;br&amp;gt;&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dialog.aspx &lt;br /&gt;&lt;/strong&gt;(Using the value from the TextBox to return to the parent as the new Session value):&lt;/p&gt;
&lt;p&gt;&amp;lt;form id=&amp;quot;Form1&amp;quot; method=&amp;quot;post&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;asp:textbox id=&amp;quot;TextBox1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:textbox&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;input type=&amp;quot;button&amp;quot; onclick=&amp;quot;closeDialog();&amp;quot; value=&amp;quot;Close&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function closeDialog()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;window.returnValue = document.getElementById(&amp;#39;&amp;lt;%= TextBox1.ClientID %&amp;gt;&amp;#39;).value;&lt;br /&gt;&amp;nbsp;window.close();&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;NC...&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/3039820.aspx</link><pubDate>Thu, 26 Mar 2009 12:03:39 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3039820</guid><dc:creator>nikhil20980</dc:creator><author>nikhil20980</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3039820.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3039820</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi NC01,&lt;/p&gt;&lt;p&gt;&amp;nbsp;Is there a way to implement this with ModalDialog?&lt;/p&gt;&lt;p&gt;&amp;nbsp;I tried but it throws window.opener is NULL or not an object.&lt;/p&gt;&lt;p&gt;Can&amp;#39;t get it throgh. Works fine with the normal popup but my requirement is a Modal popup window.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/2586555.aspx</link><pubDate>Thu, 28 Aug 2008 14:21:22 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2586555</guid><dc:creator>NC01</dc:creator><author>NC01</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2586555.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2586555</wfw:commentRss><description>&lt;p&gt;You need to code for browser compatibility issues. Test for the object before calling it. For example:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var keyStroke = (event.which) ? event.which : (window.event) ? window.event.keyCode : -1;&lt;/p&gt;
&lt;p&gt;As for calling server-side code from the client, there are really only 2 ways. A full PostBack using __doPostBack(targ, arg) or a partial PostBack (AJAX). The methods that you mentioned are really offshoots of AJAX. A Google search should tell you all that you want to know about any of them.&lt;/p&gt;
&lt;p&gt;NC...&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/2586436.aspx</link><pubDate>Thu, 28 Aug 2008 13:38:33 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2586436</guid><dc:creator>satish4asp</dc:creator><author>satish4asp</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2586436.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2586436</wfw:commentRss><description>&lt;p&gt;Hi NC01,&lt;/p&gt;
&lt;p&gt;Thank you for your&amp;nbsp;valuable suggessions,and I follow your posts regularly,It was really so much impressing.&lt;/p&gt;
&lt;p&gt;If possible let me clarify a few things on this...&lt;/p&gt;
&lt;p&gt;1) How should we know&amp;nbsp;&amp;nbsp;whether the piece of code works for all browsers (Browser compatibility issues)&lt;/p&gt;
&lt;p&gt;For ex: event.keyCode does n&amp;#39;t work &amp;nbsp;for Mozilla (like this....)&lt;/p&gt;
&lt;p&gt;Is there any simple way to find out that code will works for all browsers or not ?&lt;/p&gt;
&lt;p&gt;2)What&amp;nbsp;are the diff ways for calling code behind methods from client side?&lt;/p&gt;
&lt;p&gt;Presently I know Calling Ajax static methods,_doPostBack(&amp;#39;&amp;#39;,&amp;#39;&amp;#39;)..Raisepostback event ,ICallBackEvent and click() event..&lt;/p&gt;
&lt;p&gt;I think this would be useful for others also....&lt;/p&gt;
&lt;p&gt;Thanks in advance..&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Satish.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/2586130.aspx</link><pubDate>Thu, 28 Aug 2008 11:28:39 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2586130</guid><dc:creator>NC01</dc:creator><author>NC01</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2586130.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2586130</wfw:commentRss><description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;window.opener.document.getElementById(&amp;#39;btnhidOpenChild&amp;#39;).click();&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This does not work in all browsers. In some browsers you will get a security violation instead.&lt;/p&gt;
&lt;p&gt;NC...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/2585352.aspx</link><pubDate>Thu, 28 Aug 2008 06:02:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2585352</guid><dc:creator>satish4asp</dc:creator><author>satish4asp</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2585352.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2585352</wfw:commentRss><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;First of all let me explain about my previous post.&lt;/p&gt;
&lt;p&gt;As everybody knows Client script executes first then only follows serverside code.&lt;/p&gt;
&lt;p&gt;By using window.showModalDialog for open child popup ,it waits for that chld return value and then executes remaining client side code and then server side exode executes for that button.&lt;/p&gt;
&lt;p&gt;As NC01 told that window.showModalDialog work only for IE and that posted solution was good.&lt;/p&gt;
&lt;p&gt;Also Iam suggesting a simle way without using sessions &lt;/p&gt;
&lt;p&gt;Look at the following also...&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ParentPage is like this...&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;hidden&amp;quot; id=&amp;quot;hidden1&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;button&amp;quot; id=&amp;quot;btnOpenChild&amp;quot; value=&amp;quot;Open&amp;quot; runat=&amp;quot;server&amp;quot; onclick=&amp;quot;return window.open(&amp;#39;Child.aspx&amp;#39;);return false;&amp;quot;&amp;nbsp; /&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;button&amp;quot; id=&amp;quot;btnhidOpenChild&amp;quot; runat=&amp;quot;Server&amp;quot; style=&amp;quot;display:none&amp;quot; onserverclick=&amp;quot;btnOpenChild_click&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Code behind for ParentPage..&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;protected void btnOpenChild_click(object sender, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string str;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; str = this.hidden1.Value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Write(str);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;and Child Page ...&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;text&amp;quot; id=&amp;quot;txtchild&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;button&amp;quot; id=&amp;quot;btnOpenChild&amp;quot; runat=&amp;quot;server&amp;quot; value=&amp;quot;Close&amp;quot; onclick=&amp;quot;return PopupClose();return false;&amp;quot;&amp;nbsp; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;Javascript for ChildPage..&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;function PopupClose()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var sValue=document.getElementById(&amp;#39;txtchild&amp;#39;).value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(sValue!=null &amp;amp;&amp;amp; sValue!=&amp;quot;&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;window.opener.document.getElementById(&amp;#39;hidden1&amp;#39;).value=sValue;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.opener.document.getElementById(&amp;#39;btnhidOpenChild&amp;#39;).click();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;window.close();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;Nothing is new here...I just called that Parentpage button click event in child page...&lt;/p&gt;
&lt;p&gt;Let us know if You have any concerns on this...&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Satish&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/2583943.aspx</link><pubDate>Wed, 27 Aug 2008 15:16:47 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2583943</guid><dc:creator>NC01</dc:creator><author>NC01</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2583943.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2583943</wfw:commentRss><description>&lt;p&gt;Here&amp;#39;s a complete sample. Try this.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ParentWindow.aspx:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;form id=&amp;quot;Form1&amp;quot; method=&amp;quot;post&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;input type=&amp;quot;button&amp;quot; onclick=&amp;quot;window.open(&amp;#39;ChildWindow.aspx&amp;#39;);&amp;quot; value=&amp;quot;Open Child Window&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ParentWindow.aspx.cs:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;private void Page_Load(object sender, System.EventArgs e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;// Insure that the __doPostBack() JavaScript method is created...&lt;br /&gt;&amp;nbsp;this.GetPostBackEventReference(this, string.Empty);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;if ( this.IsPostBack )&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;string eventTarget = (this.Request[&amp;quot;__EVENTTARGET&amp;quot;] == null) ? string.Empty : this.Request[&amp;quot;__EVENTTARGET&amp;quot;];&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;if ( eventTarget == &amp;quot;ChildWindowPostBack&amp;quot; )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write(&amp;quot;Session: [&amp;quot; + this.Session[&amp;quot;ChildWindowKey&amp;quot;] + &amp;quot;]&amp;lt;br&amp;gt;&amp;quot;);&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ChildWindow.aspx:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;form id=&amp;quot;Form1&amp;quot; method=&amp;quot;post&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;asp:button id=&amp;quot;postBackButton&amp;quot; onclick=&amp;quot;postBackButton_Click&amp;quot; runat=&amp;quot;server&amp;quot; text=&amp;quot;Post Back&amp;quot;&amp;gt;&amp;lt;/asp:button&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function closeWindow()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;window.opener.__doPostBack(&amp;#39;ChildWindowPostBack&amp;#39;, &amp;#39;&amp;#39;);&lt;br /&gt;&amp;nbsp;window.close();&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ChildWindow.aspx.cs:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;protected void postBackButton_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;this.Session[&amp;quot;ChildWindowKey&amp;quot;] = &amp;quot;Value from child window&amp;quot;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;this.RegisterStartupScript(&amp;quot;CloseWindowScript&amp;quot;, &amp;quot;&amp;lt;script type=&amp;#39;text/javascript&amp;#39;&amp;gt;closeWindow();&amp;lt;/script&amp;gt;&amp;quot;);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Note that RegisterOnSubmitStatement, RegisterStartupScript, RegisterClientScriptBlock, etc have changed since version 1.1 and you will get a compiler warning with the above. &lt;br /&gt;See &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.aspx&lt;/a&gt; for more information.&lt;/p&gt;
&lt;p&gt;Also, if using AJAX, you must substitute a ScriptManager object call for the ClientScript object call. See &lt;a href="http://tech-review.org/blogs/.net_2.0/archive/2007/02/08/lets-talk-scriptmanger.aspx"&gt;http://tech-review.org/blogs/.net_2.0/archive/2007/02/08/lets-talk-scriptmanger.aspx&lt;/a&gt; for more information.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;BTW, showModalDialog is only available in Internet Explorer.&lt;/p&gt;
&lt;p&gt;NC...&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/2583855.aspx</link><pubDate>Wed, 27 Aug 2008 14:49:54 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2583855</guid><dc:creator>ManjunathMR</dc:creator><author>ManjunathMR</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2583855.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2583855</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for the reply. In the javascript i&amp;#39;m using i get only the option for window.open() and not for window.showmodaldialog().&lt;/p&gt;
&lt;p&gt;What may be the reason? Does it come for only ajax enabled website? Mine is not.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Manjunath M. R.&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/2583666.aspx</link><pubDate>Wed, 27 Aug 2008 13:53:47 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2583666</guid><dc:creator>ManjunathMR</dc:creator><author>ManjunathMR</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2583666.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2583666</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for the reply. What u said is right. But the problem is that I should be able to access the value in the popup in the same button event that caused the popup on the client side. &lt;/p&gt;
&lt;p&gt;What I mean is I want to access the value set in the child popup in the butt0n_click event in the parent.aspx.cs .&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using the following approach.&lt;/p&gt;
&lt;p&gt;1. When the user clicks on the button I have the following java script executed on the client side&lt;/p&gt;
&lt;p&gt;function openwin()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;window.open(........);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;In the click event&lt;/p&gt;
&lt;p&gt;button_click(....)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;t1.text= Request[&amp;quot;hidden1&amp;quot;];&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;in the child page&lt;/p&gt;
&lt;p&gt;I have a text box t2 and button b&lt;/p&gt;
&lt;p&gt;in the button b clientclickevent I have the followin javascript&lt;/p&gt;
&lt;p&gt;function set()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;window.opener.document.getelementbyid(&amp;#39;hidden1&amp;#39;).value=document.getelementbyid(&amp;#39;t2&amp;#39;).value;&lt;/p&gt;
&lt;p&gt;window.close();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The problem Is that the value of t1 gets updated when I click the button for the second time.&lt;/p&gt;
&lt;p&gt;What&amp;#39;s the solution for the value to get updated on the first click?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Manjunath M. R.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/2583631.aspx</link><pubDate>Wed, 27 Aug 2008 13:43:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2583631</guid><dc:creator>satish4asp</dc:creator><author>satish4asp</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2583631.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2583631</wfw:commentRss><description>&lt;p&gt;Hi,&lt;br /&gt;Try with the following...&lt;br /&gt;If the parent page is like this then......&lt;br /&gt;&amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;text&amp;quot; id=&amp;quot;txtParentBox&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;button&amp;quot; id=&amp;quot;btnOpenChild&amp;quot; value=&amp;quot;Open&amp;quot; runat=&amp;quot;server&amp;quot; onclick=&amp;quot;PopupOpen();&amp;quot; onserverclick=&amp;quot;btnOpenChild_click&amp;quot; /&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;/p&gt;
&lt;p&gt;and Javascript function in parent form ....&lt;br /&gt;function PopupOpen()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var sReturnvalue,vUrl;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var vWidth, vHeight;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vWidth = 250;&lt;br /&gt;&amp;nbsp;&amp;nbsp;vHeight = 200;&lt;br /&gt;&amp;nbsp;&amp;nbsp;vUrl=&amp;quot;Child.aspx&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sReturnvalue=window.showModalDialog(vUrl, this, &amp;#39;dialogwidth:300px;dialogHeight:125px;dialogLeft:&amp;#39; + (((screen.width - vWidth) / 2) + 200) + &amp;#39;;dialogTop:&amp;#39; + (((screen.height - vHeight) / 2) + 100) + &amp;#39;;help: No; status:no&amp;#39;+&amp;#39;;scroll:No&amp;#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(sReturnvalue!=null &amp;amp;&amp;amp; sReturnvalue!=&amp;quot;&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&amp;#39;txtParentBox&amp;#39;).value=sReturnvalue;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;then codebehind of Parent Page&lt;br /&gt;protected void btnOpenChild_click(object sender, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string str;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; str = txtParentBox.Value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;This is the child page...&lt;br /&gt;&amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;text&amp;quot; id=&amp;quot;txtchild&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;button&amp;quot; id=&amp;quot;btnOpenChild&amp;quot; runat=&amp;quot;server&amp;quot; value=&amp;quot;Close&amp;quot; onclick=&amp;quot;return PopupClose();return false;&amp;quot;&amp;nbsp; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;br /&gt;and Javascript function in child page....&lt;br /&gt;function PopupClose()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var sValue=document.getElementById(&amp;#39;txtchild&amp;#39;).value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(sValue!=null &amp;amp;&amp;amp; sValue!=&amp;quot;&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.returnValue = sValue;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;window.close();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;If I misunderstood your problem ,feel free to let us know.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Satish.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Passing data from popup to parent window using session variables</title><link>http://forums.asp.net/thread/2582711.aspx</link><pubDate>Wed, 27 Aug 2008 07:57:44 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2582711</guid><dc:creator>NHOQUE</dc:creator><author>NHOQUE</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2582711.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2582711</wfw:commentRss><description>&lt;p&gt;In Parent window,&lt;/p&gt;
&lt;p&gt;create an element like this,&lt;/p&gt;
&lt;p&gt;&amp;lt;input id=&amp;quot;parentID&amp;quot; value=&amp;quot;&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;In Child window,&lt;/p&gt;
&lt;p&gt;using javascript,&lt;/p&gt;
&lt;p&gt;window.opener.document.getElementById(&amp;quot;parentID&amp;quot;)= document.getElementById(&amp;quot;your_TextBox_ID_in_Child_window&amp;quot;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;then in parent page.,in the codebhind&lt;/p&gt;
&lt;p&gt;you can achieve it by,&lt;/p&gt;
&lt;p&gt;String myPopupData=parentID.value;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;</description></item></channel></rss>