Results 1 to 6 of 6

Thread: request.querystring with framesets?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537

    request.querystring with framesets?

    I have a nested frameset doc.

    looks like this
    Code:
    <FRAMESET rows="80,*" border=0 noresize> 
        <FRAME NAME="fraTop" SRC="top.asp"scrolling=no marginheight=0 marginwidth=0>
    	<frame name="fraBot" src="bot_frame.asp" scrolling=no marginheight=0 marginwidth=0>
    </FRAMESET>
    fraBot is another frameset that calls a left page(navigation) and a right page(content)

    the content page is an .asp page that looks for parameters in the querystring.
    seems like it should work but it does not.

    the code in my content page is very simple.

    Code:
    if request.querystring("action")="go" then
    response.write "welcome"
    else
    response.write "your not welcome"
    end if
    any suggestions?

    I can't use session variables or I would do it that way.
    pnj

  2. #2
    Lively Member
    Join Date
    Aug 2002
    Location
    SwitzerLANd
    Posts
    65
    well if you have just one query then do it like this:

    If Request.QueryString="welcome" Then
    response.write "welcome"
    Else
    response.write "***** off"
    End If

    and the URL should be just "http://your.server.something/default.asp?welcome"

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    i may have more than one query but the problem seems to be that i can't access the querystring.

    i can see all the variables in the querystring, i just can't get them in the nested frameset doc.


    i think i fixed it by using cookies.....

    should work.
    pnj

  4. #4
    Lively Member
    Join Date
    Aug 2002
    Location
    SwitzerLANd
    Posts
    65
    i h8 c00kies, but if it doesn't work otherwise

  5. #5
    Lively Member
    Join Date
    Aug 2002
    Location
    SwitzerLANd
    Posts
    65
    try this one, it worx well for me:

    select case Request.QueryString("mode")
    case "enter"
    response.write="hi"
    case else
    response.write="bye"
    end select

  6. #6
    Addicted Member
    Join Date
    Oct 2000
    Location
    Québec, Canada
    Posts
    212
    Ok, seems like you're trying to pass querystring to frames.
    There is 2 possibilities :

    A) The querystring is in your frameholder, so just create the <frameset...> tag dynamically :

    Code:
    <FRAMESET rows="80,*" border=0 noresize> 
        <FRAME NAME="fraTop" SRC="top.asp?MyVar=<%= Request.Querystring("MyVar") %>&MyVar2=<%= Request.Querystring("MyVar2") %>"
    scrolling=no marginheight=0 marginwidth=0>
    	<frame name="fraBot" src="bot_frame.asp" scrolling=no marginheight=0 marginwidth=0>
    </FRAMESET>
    B) Your querystring is in the top frame. This one is a bit trickier.
    Basically, the idea is to get a client script (javascript) on the top frame to refresh the bottom frame with the good page & querystring :

    Code:
    <script language="javascript">
    <% If Request.Querystring("MyVar") = "Allowed" Then %>
    parent.frames[1].location = 'allowed.asp?Whatever=whatever';
    <% Else %>
    parent.frames[1].location = 'notallowed.asp?reason=notfunny';
    <% End if %>
    </script>
    Not sure about the exact syntax of parent.frames[x] part though, I'm at work right now and don't have the code at hand.
    Last edited by eL_NiNo; Aug 13th, 2002 at 10:50 AM.
    Regards,

    El-Nino

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width