Subject: Pass variable to main form dataset
Posted By: spacky001 Post Date: 9/13/2006 5:17:16 AM
Hi, I have a popup window that loads a filter aspx page where a string is entered to filter a dataset to be displayed in a datagrid of the main page that opens the popup. I have a radiobuttonlist and textbox that passes the value of the column name and querystring respectively to be used to filter the rows. How do i obtain these values and pass them back to the main form using javascript.

Any help appreciated.


If at first you don't succeed, skydiving is probably not for you!
Skydiving anybody?
Reply By: dparsons Reply Date: 9/13/2006 7:02:50 AM
Pass them via query string dynamically.  

something like this:

string sJavaScript;

sJavaScript = "<script langauge=javascript>";
sJavaScript += "window.opener.location.href='./somepage.aspx?value1=" & somevalue & "&value2=" & somevalue & "';";
sJavaScript += "window.close();"
sJavaScript += "</scr" & "ipt>";

Response.Write(sJavaScript);

Handle the query string values on the original page and also notice the last line of sJavaScript how the closing script tag is split up, keep it like that or you will get a JavaScript error if you try to just appened "</script>" to the string.

"The one language all programmers understand is profanity."
Reply By: spacky001 Reply Date: 9/13/2006 10:10:53 PM
Thankyou for that, works like a charm. I am curious though as to why the closing tag needs to be split up. Seems to me like it would be a major headache for many people. I put it in as a single string and its working fine, but Im also using C#. Im not sure if that matters though. Or is it a browser capable thing?

Go to topic 49718

Return to index page 175
Return to index page 174
Return to index page 173
Return to index page 172
Return to index page 171
Return to index page 170
Return to index page 169
Return to index page 168
Return to index page 167
Return to index page 166