Home All Groups Group Topic Archive Search About

To pass a parameter from an URL to a page with frames



Author
19 Mar 2005 3:27 PM
LarryM
Hi,

A newbie-question:

I would like to send in a parameter with the starting link.

I suppose I can do this with: 'http://www.mySite.com?param=xxx'.
But I cannot figure out how to read that param-value.
Putting '?param=xxx' after the websiteName does not indicate exactly which page
is receiving the parameter.

My first page (default.asp) has two frames.
So there is html code in the Frameset, and in the two pages (LeftPage and
Rightpage) in the frames (LeftFrame and RightFrame).
I have tried to put in
<%
Dim wParam
wParam = Request.Querystring("param")
Response.Write "param=" & wParam<br>"
'---
%>
in ASP code in all three places but don't seem to be able to read the param
value placed in the starting URL.

I would like to use the param value in the RightPage.

What am I doing wrong?

thanks in advance
Larry

Author
19 Mar 2005 4:03 PM
Evertjan.
LarryM wrote on 19 mrt 2005 in microsoft.public.inetserver.asp.general:

Show quote
> Hi,
>
> A newbie-question:
>
> I would like to send in a parameter with the starting link.
>
> I suppose I can do this with: 'http://www.mySite.com?param=xxx'.
> But I cannot figure out how to read that param-value.
> Putting '?param=xxx' after the websiteName does not indicate exactly
> which page is receiving the parameter.
>
> My first page (default.asp) has two frames.
> So there is html code in the Frameset, and in the two pages (LeftPage
> and Rightpage) in the frames (LeftFrame and RightFrame).
> I have tried to put in
> <%
> Dim wParam
> wParam = Request.Querystring("param")
> Response.Write "param=" & wParam<br>"
> '---
> %>

the frameset page does not show html text, so Response.Write does not
have the effect you want.

However the frameset default.asp could send
the Request.Querystring("param") to the left.asp using querystring

frame src="left.asp?param="<%=Request.Querystring("param")%>

or using a session variable

<%
session("myparam") = Request.Querystring("param")
%>

However, preferably do not use frames, they are evil, and [if you are up
to the level of programming in asp] you can create the window as one page
possibly with includes.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)
Author
19 Mar 2005 5:04 PM
LarryM
Show quote
On 19 Mar 2005 16:03:26 GMT, "Evertjan." <exjxw.hannivo***@interxnl.net> wrote:

>LarryM wrote on 19 mrt 2005 in microsoft.public.inetserver.asp.general:
>
>> Hi,
>>
>> A newbie-question:
>>
>> I would like to send in a parameter with the starting link.
>>
>> I suppose I can do this with: 'http://www.mySite.com?param=xxx'.
>> But I cannot figure out how to read that param-value.
>> Putting '?param=xxx' after the websiteName does not indicate exactly
>> which page is receiving the parameter.
>>
>> My first page (default.asp) has two frames.
>> So there is html code in the Frameset, and in the two pages (LeftPage
>> and Rightpage) in the frames (LeftFrame and RightFrame).
>> I have tried to put in
>> <%
>> Dim wParam
>> wParam = Request.Querystring("param")
>> Response.Write "param=" & wParam<br>"
>> '---
>> %>
>
>the frameset page does not show html text, so Response.Write does not
>have the effect you want.
>
>However the frameset default.asp could send
>the Request.Querystring("param") to the left.asp using querystring
>
>frame src="left.asp?param="<%=Request.Querystring("param")%>"
>
(I think I completed the last line correctly)

I am puzzled because the left.asp does not seem to receive 'param'.

In left.asp I have
<%
Dim wParam
wParam = Request.Querystring("param")
Response.Write "param=" & wParam
%>

Out on left.asp comes only 'param='  .

But, if I get you right - the param in 'http://mywebSite?param=xxx'
IS being caught by the Frameset, and could be sent on to 'left.asp'.
But, well, it does not happen for me...yet.


regards
Larry
Author
19 Mar 2005 5:32 PM
LarryM
...and now it works!
some typo error from my side.
thanks
Larry
Author
19 Mar 2005 5:53 PM
Evertjan.
LarryM wrote on 19 mrt 2005 in microsoft.public.inetserver.asp.general:

>>frame src="left.asp?param="<%=Request.Querystring("param")%>"
>>
> (I think I completed the last line correctly)
>

<frame src="left.asp?param=<%=Request.Querystring("param")%>">

[one doublequote less]

Remember that ASP serverside processing doesn't even know what a frame is.

Why not try the session variable solution,
or even better, no frames at all?

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

AddThis Social Bookmark Button