Server.Transfer and passing values

Discussion in 'ASP General' started by Dr. Know, Jan 25, 2005.

  1. Dr. Know

    Dr. Know Guest

    When using the Response.Redirect in test1.asp in this manner:

    Response.Redirect ("test2.asp?err=something&msg=somethingelse")

    You can pass values calculated in test1.asp to test2.asp.
    But this is a round trip redirect - and also shows passed values in
    the address bar.

    But when using Server.Transfer, as in:

    Server.Transfer ("test2.asp?err=something&msg=somethingelse")

    This is apparently not allowed, as I get an error claiming that
    non-relative references in the path of the file are not allowed.

    My question is:

    *Without* using application or session stores, how can you pass values
    between pages called in this manner - values that are not a part of
    the originally submitted information?

    Thanks,

    Greg











    Dr. Know
     
    Dr. Know, Jan 25, 2005
    #1
    1. Advertising

  2. Dr. Know

    Evertjan. Guest

    Dr. Know wrote on 25 jan 2005 in microsoft.public.inetserver.asp.general:

    > But when using Server.Transfer, as in:
    >
    > Server.Transfer ("test2.asp?err=something&msg=somethingelse")
    >
    > This is apparently not allowed, as I get an error claiming that
    > non-relative references in the path of the file are not allowed.
    >
    > My question is:
    >
    > *Without* using application or session stores, how can you pass values
    > between pages called in this manner - values that are not a part of
    > the originally submitted information?
    >


    ---------test.asp

    <%
    a = 3
    %>
    <!-- #include virtual ="test2.asp"-->


    ---------test2.asp

    <%
    response.write a
    %>

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

  3. Dr. Know

    Dr. Know Guest

    Evertjan. said:

    >Dr. Know wrote on 25 jan 2005 in microsoft.public.inetserver.asp.general:
    >> My question is:
    >>
    >> *Without* using application or session stores, how can you pass values
    >> between pages called in this manner - values that are not a part of
    >> the originally submitted information?
    >>

    >---------test.asp
    ><%
    >a = 3
    >%>
    ><!-- #include virtual ="test2.asp"-->
    >
    >---------test2.asp
    ><%
    >response.write a
    >%>


    Yes, this works - and I have to admit, I hadn't tried it.
    I made minor modifications to both scripts - and it does work.

    But...
    The reason I hadn't tried it was a concern that if you had 3 or 4
    possible files to refer to, that the overhead of loading all of the
    ..inc files would deaden response time, as they are ALL loaded before
    the script runs

    Say the ASP page is a form...
    The user fills out the form and posts it...
    The ASP page decides which of 4 pages to refer the user to...

    Using the .INC method, all four pages are loaded before the script
    executes, but only the appropriate text is output back to the user.

    Using the referrer method, the client just gets directed to another
    form.

    Which is more efficient - Time and CPU-utilization wise?
    Or would it simply depend on the individual app. in question?


    Thanks,
    Greg







    Dr. Know
     
    Dr. Know, Jan 25, 2005
    #3
    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. KathyB
    Replies:
    3
    Views:
    2,426
    Axel Dahmen
    Jul 1, 2003
  2. Gary Varga

    Server.Transfer loses posted values

    Gary Varga, Jul 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    385
    Gary Varga
    Jul 22, 2003
  3. Replies:
    1
    Views:
    515
    Brock Allen
    Apr 5, 2005
  4. Pete
    Replies:
    7
    Views:
    292
  5. Jim
    Replies:
    1
    Views:
    964
    Aaron Bertrand - MVP
    Jan 28, 2004
Loading...

Share This Page