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

L

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
 
E

Evertjan.

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")%>

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.
 
L

LarryM

LarryM wrote on 19 mrt 2005 in microsoft.public.inetserver.asp.general:


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
 
E

Evertjan.

LarryM wrote on 19 mrt 2005 in microsoft.public.inetserver.asp.general:
(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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top