Re: Request.QueryString() and/or Request.Form()

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Kevin Spencer (kevin_at_takempis.com)
Date: 04/02/04


Date: Fri, 2 Apr 2004 08:53:49 -0500

Hi George,

If I understand you correctly, you are using the JavaScript window.open()
mthod to open a child window, and you want to retrieve some form values from
the parent window in the child window? If that's the case, you should be
aware that the only way for those 2 pages to "talk" is on the client, via
JavaScript. On the server, the classes don't even exist at the same time.
Only on the client are they concurrent and able to communicate. In the child
window, you refer to the parent window as "opener." So, if you want to get
the value of a form field in the parent with the name "foo" you could use
something like the following:

<script type="text/javascript"><!--
    var s = opener.document.forms[0].foo.value;
// --></script>

-- 
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"George" <------@----.---> wrote in message
news:ci1bc.9940$vo5.303853@bgtnsc05-news.ops.worldnet.att.net...
> Marina,
>
> Actually, I didn't really explain my problem very well.
>
> I have an .htm page that uses an HTML form button to open my .aspx page in
a new window without any
> buttons on it. That may be why I can't retrieve my hidden inputs in the
HTML form, because, even
> though the method is set to POST, the action is set to call a javascript
function that uses
> window.open() to open my .aspx page in the new window, instead of the
action being set to call the
> .aspx page directly.
>
> I am not certain, but is it possible to retrieve those hidden inputs like
that? If not, is there
> anyway of doing it?
>
> Thanks,
> George
>
>
> "Marina" <someone@nospam.com> wrote in message
news:eRu2etDGEHA.3880@TK2MSFTNGP09.phx.gbl...
> > Request.QueryString is only for parameters passed in the URL.
> >
> > Request.Form works very nicely for retrieving posted hidden controls.
> >
> > "George" <------@----.---> wrote in message
> > news:QC0bc.9809$vo5.299458@bgtnsc05-news.ops.worldnet.att.net...
> > > VS.NET 2002/VB
> > >
> > > Is it possible to retrieve HTML form variables that are hidden input
types
> > using
> > > Request.QueryString() and/or Request.Form()?
> > >
> > > I have tried various ways of using those, but to no avail. My HTML
form
> > method is set to POST, and I
> > > thought I had read somewhere that this could be done.
> > >
> > > If it is not possible, is there any way to retrieve HTML form
variables
> > into my .aspx page?
> > >
> > > Thanks,
> > > George
> > >
> > >
> > >
> >
> >
>
>

Quantcast