Passing Values Between Web Forms Pages

Discussion in 'ASP .Net' started by cgia, Jul 25, 2003.

  1. cgia

    cgia Guest

    I am porting an old client/server application to asp.net. I used to
    retrieve data into local tables (Paradox table-files on the client's
    disk) and work on them before saving them back to the server. What is
    the approach for this in asp.net? The comments in MSDN on using the
    session object are scary, imagining that several users at the same
    time will use plenty of space on the server's memory! Or is it
    realistic to memorize the data in a page and access them from the
    following pages?
    Thank for your help!
    cgia, Jul 25, 2003
    #1
    1. Advertising

  2. There are a lot of options to transferring values between pages: Session
    like you've mentioned, The querystring (of course), But you may want to look
    into Server.Transfer and the Context Object.

    I hope this leads you in the right direction.

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche
    "cgia" <> wrote in message
    news:...
    > I am porting an old client/server application to asp.net. I used to
    > retrieve data into local tables (Paradox table-files on the client's
    > disk) and work on them before saving them back to the server. What is
    > the approach for this in asp.net? The comments in MSDN on using the
    > session object are scary, imagining that several users at the same
    > time will use plenty of space on the server's memory! Or is it
    > realistic to memorize the data in a page and access them from the
    > following pages?
    > Thank for your help!
    S. Justin Gengo, Jul 25, 2003
    #2
    1. Advertising

  3. You can add objects to the HttpContext of the current Page, and then use
    Server.Transfer to transfer to the next page. The HttpContext is transferred
    as well, and you can pull the data from the original page out of that.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Big things are made up of
    lots of little things.

    "cgia" <> wrote in message
    news:...
    > I am porting an old client/server application to asp.net. I used to
    > retrieve data into local tables (Paradox table-files on the client's
    > disk) and work on them before saving them back to the server. What is
    > the approach for this in asp.net? The comments in MSDN on using the
    > session object are scary, imagining that several users at the same
    > time will use plenty of space on the server's memory! Or is it
    > realistic to memorize the data in a page and access them from the
    > following pages?
    > Thank for your help!
    Kevin Spencer, Jul 25, 2003
    #3
  4. Here's a nice, simple way to pass values from one page to another:
    (VB.NET code)

    'Add data to the context object before transferring
    Context.Items("myParameter") = x
    Server.Transfer("WebForm2.aspx")

    Then, in WebForm2.aspx:

    'Grab data from the context property
    Dim x as Integer = CType(Context.Items("myParameter"),Integer)

    Of course there are a number of ways to pass values from one page to
    another, such as using the querystring, cookies, session,
    context, saving to a temporary table in the database between each page, etc.
    You'll have to decide which technique is best for your application.
    Here are several good articles on the subject to help you decide.
    http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx

    http://www.aspalliance.com/kenc/passval.aspx

    http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=600

    http://www.dotnetbips.com/displayarticle.aspx?id=79

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net


    "cgia" <> wrote in message
    news:...
    > I am porting an old client/server application to asp.net. I used to
    > retrieve data into local tables (Paradox table-files on the client's
    > disk) and work on them before saving them back to the server. What is
    > the approach for this in asp.net? The comments in MSDN on using the
    > session object are scary, imagining that several users at the same
    > time will use plenty of space on the server's memory! Or is it
    > realistic to memorize the data in a page and access them from the
    > following pages?
    > Thank for your help!
    Steve C. Orr, MCSD, Jul 25, 2003
    #4
  5. cgia

    cgia Guest

    Actually what I want to transfer between forms is huge tables... do
    you think it is appropriate to use the server.transfer?



    (cgia) wrote in message news:<>...
    > I am porting an old client/server application to asp.net. I used to
    > retrieve data into local tables (Paradox table-files on the client's
    > disk) and work on them before saving them back to the server. What is
    > the approach for this in asp.net? The comments in MSDN on using the
    > session object are scary, imagining that several users at the same
    > time will use plenty of space on the server's memory! Or is it
    > realistic to memorize the data in a page and access them from the
    > following pages?
    > Thank for your help!
    cgia, Jul 26, 2003
    #5
  6. Yes, that seems like one of the more efficient solutions for this particular
    problem.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net


    "cgia" <> wrote in message
    news:...
    > Actually what I want to transfer between forms is huge tables... do
    > you think it is appropriate to use the server.transfer?
    >
    >
    >
    > (cgia) wrote in message

    news:<>...
    > > I am porting an old client/server application to asp.net. I used to
    > > retrieve data into local tables (Paradox table-files on the client's
    > > disk) and work on them before saving them back to the server. What is
    > > the approach for this in asp.net? The comments in MSDN on using the
    > > session object are scary, imagining that several users at the same
    > > time will use plenty of space on the server's memory! Or is it
    > > realistic to memorize the data in a page and access them from the
    > > following pages?
    > > Thank for your help!
    Steve C. Orr, MCSD, Jul 26, 2003
    #6
    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. Matt M
    Replies:
    1
    Views:
    1,066
    Matt M
    Aug 28, 2003
  2. Greg Decos
    Replies:
    2
    Views:
    400
    Greg Decos
    Apr 15, 2004
  3. Shankar Ayyachamy
    Replies:
    4
    Views:
    521
    IPGrunt
    Jan 28, 2005
  4. Mani P.S via .NET 247

    Passing values between forms

    Mani P.S via .NET 247, Apr 1, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    578
    Steve C. Orr [MVP, MCSD]
    Apr 1, 2005
  5. robkiolbasa

    Passing values between HTML forms

    robkiolbasa, Feb 12, 2007, in forum: Javascript
    Replies:
    2
    Views:
    123
    robkiolbasa
    Feb 12, 2007
Loading...

Share This Page