|
-
Oct 26th, 2006, 07:31 AM
#1
Thread Starter
Addicted Member
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
-
Oct 27th, 2006, 07:58 AM
#2
Thread Starter
Addicted Member
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
-
Oct 30th, 2006, 04:21 PM
#3
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.
-
Oct 31st, 2006, 04:47 AM
#4
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|