Putting Current URL in a Session Variable

Discussion in 'ASP General' started by Keith, Aug 26, 2004.

  1. Keith

    Keith Guest

    Is there any way of setting the URL of the current page in a session
    variable?

    I want to do this so I can create links and redirects back to the page on
    which the user invokes a particular procedure.
    Keith, Aug 26, 2004
    #1
    1. Advertising

  2. Keith

    Keith Guest

    If it makes a difference, the site is in frames. The URL I want to capture
    is that of the page loaded in the Main frame.

    "Keith" <@.> wrote in message news:...
    > Is there any way of setting the URL of the current page in a session
    > variable?
    >
    > I want to do this so I can create links and redirects back to the page on
    > which the user invokes a particular procedure.
    >
    >
    Keith, Aug 26, 2004
    #2
    1. Advertising

  3. Keith

    Evertjan. Guest

    Keith wrote on 26 aug 2004 in microsoft.public.inetserver.asp.general:
    > "Keith" wrote in message
    >> Is there any way of setting the URL of the current page in a session
    >> variable?
    >>
    >> I want to do this so I can create links and redirects back to the
    >> page on which the user invokes a particular procedure.

    > If it makes a difference, the site is in frames. The URL I want to
    > capture is that of the page loaded in the Main frame.


    [Please do not toppost, even answering your own posts]

    <%
    mySite = "http://www.mySite.com"
    session("myUrl") = mySite & "/myfolder/mypage.asp"
    %>

    or more general [but why would you?]

    <%
    mySite = "http://www.mySite.com"
    session("myUrl") = mySite & Request.servervariables("URL")
    %>

    ASP does not know about frames !

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Aug 26, 2004
    #3
  4. Keith

    Keith Guest

    "Evertjan." <> wrote in message
    news:Xns955174E2DD065eejj99@194.109.133.29...
    > Keith wrote on 26 aug 2004 in microsoft.public.inetserver.asp.general:
    > > "Keith" wrote in message
    > >> Is there any way of setting the URL of the current page in a session
    > >> variable?
    > >>
    > >> I want to do this so I can create links and redirects back to the
    > >> page on which the user invokes a particular procedure.

    > > If it makes a difference, the site is in frames. The URL I want to
    > > capture is that of the page loaded in the Main frame.

    >
    > [Please do not toppost, even answering your own posts]
    >
    > <%
    > mySite = "http://www.mySite.com"
    > session("myUrl") = mySite & "/myfolder/mypage.asp"
    > %>
    >
    > or more general [but why would you?]
    >
    > <%
    > mySite = "http://www.mySite.com"
    > session("myUrl") = mySite & Request.servervariables("URL")
    > %>
    >
    > ASP does not know about frames !
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress,
    > but let us keep the discussions in the newsgroup)


    The second method is great (using request.servervariables("url").

    However, is there a way of also capturing any parameters that were passed to
    the page when it was opened?
    Keith, Aug 26, 2004
    #4
  5. Keith

    Evertjan. Guest

    Keith wrote on 26 aug 2004 in microsoft.public.inetserver.asp.general:
    > The second method is great (using request.servervariables("url").
    >
    > However, is there a way of also capturing any parameters that were
    > passed to the page when it was opened?


    Sure.

    wholeQuerystring = request.querystring

    You can read the request.form collection with a for..each loop.

    =======

    btw:
    I think you will have to study ASP tutorials and [sample] page files.
    They are all over the web.
    To ask every single method of ASP programming will not get you far.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Aug 26, 2004
    #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. Saurabh
    Replies:
    6
    Views:
    4,504
    Chris Smith
    May 30, 2004
  2. chowchho
    Replies:
    7
    Views:
    619
    Patrice
    Mar 28, 2008
  3. Replies:
    1
    Views:
    108
    Daniel Crichton
    Mar 23, 2007
  4. Jack
    Replies:
    3
    Views:
    583
    Tad J McClellan
    Dec 22, 2008
  5. Replies:
    1
    Views:
    280
    Thomas 'PointedEars' Lahn
    Mar 19, 2008
Loading...

Share This Page