CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    ASP - Passing Large Amounts Of Text From One Page To Another

    Sorry if this is a little off-topic.

    Is there another way to do as the subject says other than using the command line (Request.QueryString() in VBScript)? If you want to pass a lot of text it results in a ridiculously long URL.

    --
    Jason Teagle
    [email protected]

  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: ASP - Passing Large Amounts Of Text From One Page To Another

    you can use the POST method instead of GET.
    this will not affect the address field.
    You can access the valuues in your ASP via the REQUEST object. use the Form object instead of the QueryString object.

    Also, to pass large amounts of data between pages consider using Session variables.


  3. #3
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: ASP - Passing Large Amounts Of Text From One Page To Another

    So Request.Form() can access forms on the page which sent us to the current page, then? Even though that previous page appears to have been destroyed now that we are on a new page?

    Could you tell me how to use session variables, please? An example would be great.

    Thanks.


    --
    Jason Teagle
    [email protected]

  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: ASP - Passing Large Amounts Of Text From One Page To Another

    >So Request.Form() can access forms on the page which sent us to the current page, then? Even though that previous page appears to have been destroyed now that we are on a new page?

    not exactly sure what you mean.
    Request.Form allows you to access form variables passed to your asp.
    let's say you are on page first.htm
    with
    <form name=... method=post action="yourasp.asp">
    <input type=text name="test" value="...">
    </form>

    in yourasp.asp you can access the value of field "test" via:
    request.form("test")
    or - if you are as lazy as I am - via
    request("test")

    >Could you tell me how to use session variables, please? An example would be great.

    It's just to easy:
    in yourasp1.asp

    Session("mySessionVarName") = hugeString ' ...or array


    in yourasp2.asp

    mystring =Session("mySessionVarName")

    Session vars are per user, Application vars per application.


  5. #5
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: ASP - Passing Large Amounts Of Text From One Page To Another

    >not exactly sure what you mean.
    >Request.Form allows you to access form variables passed to your asp.

    Sorry, my mistake - I was getting a little confused there. I forgot that GET gives QueryString(), POST gives Form().

    >It's just to easy:
    >Session("mySessionVarName") = hugeString ' ...or array
    >Session vars are per user, Application vars per application.

    Perfect, thankyou.



    --
    Jason Teagle
    [email protected]

  6. #6
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: ASP - Passing Large Amounts Of Text From One Page To Another

    Just a word of caution with session variables - they require that the browser have cookies turned on. i haven't had any problems with this, but apparently some people have, since there are quite a few articles about how to get around this. the server stores the user's SessionID in a cookie, so if the user isn't using cookies, the Session_OnStart event is fired every time they hit the page since the server can't read the sessionid from the cookie it tried to write.

    just a FYI.

    John

    John Pirkey
    MCSD
    www.ShallowWaterSystems.com
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

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

Featured