Results 1 to 4 of 4

Thread: Session State Problem

  1. #1

    Thread Starter
    Addicted Member señorbadger's Avatar
    Join Date
    Oct 2003
    Location
    Mud pools of wellingborough
    Posts
    193

    Exclamation Session State Problem

    Hello, I have a problem and was wondering if people could help

    My web application has a Controller class which contains an entitly class which is to be updated via AJAX over multiple postbacks, I have tried to make it so the controllers are stored in the Global.asax so that they can be accessed by a key (in a hashtable). when i retrieve the controllers they are disposed (ie: null).

    Am i approaching this wrong? i really don't get the ASP.NET model it's like rich applications but not

    Thanks for your help

    Sam

  2. #2

    Thread Starter
    Addicted Member señorbadger's Avatar
    Join Date
    Oct 2003
    Location
    Mud pools of wellingborough
    Posts
    193

    Resolved Re: Session State Problem <<SOLVED>>

    Sorry It was my own error, the key i provided back wasn't the same and when i fixed that another small problem (my own fault was caused).

    Basically using Cache is a way of doing it, Cache(ITEMKEY) = VALUE
    seems to work well

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Session State Problem

    Why would you store anything in the global.asax?

    Your approach may not be what you want. The moment the web server/service restarts, you lose your application variables/session variables/cache variables. A more prudent approach would be to store the details of it in a database, and then when a request for it comes up to :

    1) Check the cache for this object. If it exists, server it.
    2) If it does not, construct it from the data in the database, store it in cache. Then server it.

  4. #4

    Thread Starter
    Addicted Member señorbadger's Avatar
    Join Date
    Oct 2003
    Location
    Mud pools of wellingborough
    Posts
    193

    Re: Session State Problem

    Yeah i wanted to store it in a database but i have to request my boss every time i want to create a database table, and have to justify why etc. She would have declined it for sure so using the Cache was the option.

    The objects don't need to be stored forever, just so that serveral Javascript postbacks can use the same instance of a controller class which contains a document class which is to have attributes set on each postback.

    Thanks for the help anyways.

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