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

Discussion in 'ASP General' started by LarryM, Mar 19, 2005.

  1. LarryM

    LarryM Guest

    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
     
    LarryM, Mar 19, 2005
    #1
    1. Advertising

  2. LarryM

    Evertjan. Guest

    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.

    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
     
    Evertjan., Mar 19, 2005
    #2
    1. Advertising

  3. LarryM

    LarryM Guest

    On 19 Mar 2005 16:03:26 GMT, "Evertjan." <> 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
     
    LarryM, Mar 19, 2005
    #3
  4. LarryM

    LarryM Guest

    ...and now it works!
    some typo error from my side.
    thanks
    Larry
     
    LarryM, Mar 19, 2005
    #4
  5. LarryM

    Evertjan. Guest

    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)
     
    Evertjan., Mar 19, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Powerslave2112

    From Frames to no frames?

    Powerslave2112, Jan 20, 2004, in forum: HTML
    Replies:
    2
    Views:
    635
    brucie
    Jan 20, 2004
  2. Philip
    Replies:
    3
    Views:
    1,016
    Karl Groves
    Jun 28, 2004
  3. Ale

    Frames or not Frames...

    Ale, Aug 3, 2005, in forum: HTML
    Replies:
    17
    Views:
    1,003
    Adrienne
    Aug 5, 2005
  4. =?Utf-8?B?YmJzYm9i?=
    Replies:
    2
    Views:
    769
    =?Utf-8?B?YmJzYm9i?=
    Nov 24, 2006
  5. AzamSharp
    Replies:
    2
    Views:
    199
Loading...

Share This Page