Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 13th, 2006, 05:17 AM
Authorized User
 
Join Date: Nov 2005
Location: Morisset, NSW, Australia.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pass variable to main form dataset

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?
 
Old September 13th, 2006, 07:02 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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."
 
Old September 13th, 2006, 10:10 PM
Authorized User
 
Join Date: Nov 2005
Location: Morisset, NSW, Australia.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?




Similar Threads
Thread Thread Starter Forum Replies Last Post
To pass value of string variable to another form thillai Visual Basic 2005 Basics 5 March 13th, 2008 03:29 AM
How to pass values to main page from Popup window rmanmeet ASP.NET 1.0 and 1.1 Basics 1 January 5th, 2006 01:44 PM
pass form elements variable vickyj Classic ASP Basics 0 October 29th, 2005 04:58 AM
Pass Form Variable to Report (DataReport) coboy VB How-To 1 September 22nd, 2004 12:19 PM
How to pass a variable form one form to the next Dinesh22 VB.NET 2002/2003 Basics 1 January 8th, 2004 08:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.