Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Persist DropDownList values on postback
Message
From
26/11/2004 13:01:43
 
 
To
26/11/2004 04:44:18
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00964714
Message ID:
00964994
Views:
7
Cetin-

>Suggesting cache instead of session just because new caching services seemed to me more appropriate then using old session vars. Cache and enableviewstate and multiple users would benefit it I think.

I reread some of the documentation about caching.

>DataReader? Isn't it closed after first read? Even somehow it's still open wouldn't it be at 'eof'? I think you mean dataset or something like that.

The DataReader is open after the session variable is restored. But, you're right that the DataReader is restored HasRows == true and Read() == false. A little history...I started out using a dataset, but because of some of the things I read trying to assess what the best way was to manage this particular bit of data, in combination with the dropdown control, I switched to a datareader, although I was suspicious of this very state. However, I just don't undestand clearly enough what exactly happens when a dropdown is bound to a datareader. Since everything seemed to indicate a datareader + dropdown + webform would be a grand idea, I went with it. I think I should have stuck with my suspicions instead. <s>

Anyway, my conclusion is, don't use datareaders + sessions vars. And datareaders + caching are a no-no, based on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/CachingArchch4.asp.

Okay, so lession learned there. As for using the cache versus session variables generally...I *think* that caching does not necessarily _replace_ session vars.

Leaving aside this one datareader issue, I'd initially passed on caching my datasets because almost all of it is at least somewhat volatile. Although some is rather static. For example, a list of classes for a registration site. The class list does change, but not rapidly. However, the current number of registrations does rapidly change and has to be up-to-date so I can show the students what classes are closed. There's a lot of calculation that's done, and while no one minds the rate the pages load (it's not _that_ bad) I know it should be more responsive. So, caching would help that, but, and this is my own ignorance, of course, how to make use of caching? I didn't think it was possible. But, the link above says datasets "can be updated without needing to reinsert them into the cache. Because you cache a reference to your DataSet, your application can update the data without the reference in the cache needing to change."

Sooooo, well, I guess I'll have more reading to do, but any of your additional thoughts on the subject would be welcomed.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform