A class visible through out the site?

Discussion in 'ASP .Net' started by Mustafa Rabie, Jan 20, 2005.

  1. I have a registeration which is divided on 3 pages, i want to have a class
    that i can create on the 1st page, collect the data from page 1 and add the
    values to vars in the class, then page 2 and add to vars then page 3 and add
    vars then i call a web service @ page 3 and send all the data i collected.

    i created a static global class, but it doesnt create a new instance every
    call for the app, so if i have 2 ppl using the app it wont keep the vars
    sperated.

    thanks
    mustafa
     
    Mustafa Rabie, Jan 20, 2005
    #1
    1. Advertising

  2. Mustafa Rabie

    jongalloway Guest

    It sounds like you're talking about Session data, and should look at
    using the ASP.NET built in support for Session. I know I had been
    taught not to use Session in Classic ASP, but the ASP.NET Session
    System is efficient and scalable.

    If you're storing per-user information at the application level, you're
    not going to expire it when the application times out, you may have to
    deal with concurrency issues, etc. Session handles all that for you.

    Plus, if you use Session you can switch to a Session Server or use SQL
    Server Session State which will allow you to run your application in a
    load balanced environment if required later. If you're storing the
    information in memory, you can't scale out.
    - Jon
    http://weblogs.asp.net/jgalloway
     
    jongalloway, Jan 21, 2005
    #2
    1. Advertising

  3. Mustafa Rabie

    David Jessee Guest

    put the class in the session. you might want to make sure its serializable


    "Mustafa Rabie" <> wrote in message
    news:%23s9rrk0$...
    > I have a registeration which is divided on 3 pages, i want to have a class
    > that i can create on the 1st page, collect the data from page 1 and add

    the
    > values to vars in the class, then page 2 and add to vars then page 3 and

    add
    > vars then i call a web service @ page 3 and send all the data i collected.
    >
    > i created a static global class, but it doesnt create a new instance every
    > call for the app, so if i have 2 ppl using the app it wont keep the vars
    > sperated.
    >
    > thanks
    > mustafa
    >
    >
     
    David Jessee, Jan 21, 2005
    #3
  4. thanks a lot fo ryour help guys.
    but from my understanding, please correct me if i am wrong, but isn't it
    suppose that every call to the web app creates a new instance, with it's own
    vars, classes etc? or does that has to be delt with via sessions?

    Thanks
    Mustafa
    "David Jessee" <> wrote in message
    news:e$C$av3$...
    > put the class in the session. you might want to make sure its
    > serializable
    >
    >
    > "Mustafa Rabie" <> wrote in message
    > news:%23s9rrk0$...
    >> I have a registeration which is divided on 3 pages, i want to have a
    >> class
    >> that i can create on the 1st page, collect the data from page 1 and add

    > the
    >> values to vars in the class, then page 2 and add to vars then page 3 and

    > add
    >> vars then i call a web service @ page 3 and send all the data i
    >> collected.
    >>
    >> i created a static global class, but it doesnt create a new instance
    >> every
    >> call for the app, so if i have 2 ppl using the app it wont keep the vars
    >> sperated.
    >>
    >> thanks
    >> mustafa
    >>
    >>

    >
    >
     
    Mustafa Rabie, Jan 21, 2005
    #4
    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. spamfurnace
    Replies:
    1
    Views:
    2,669
    Scott M.
    May 24, 2004
  2. tshad

    button visible/not visible

    tshad, Oct 26, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    4,500
    Brian Hoops
    Oct 28, 2004
  3. tshad

    Sections visible and not visible

    tshad, Jan 31, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,091
    tshad
    Jan 31, 2005
  4. Patrick Olurotimi Ige
    Replies:
    7
    Views:
    6,052
    Patrick Olurotimi Ige
    Jun 15, 2005
  5. tshad
    Replies:
    1
    Views:
    4,341
    tshad
    Oct 31, 2009
Loading...

Share This Page