Baran Topal

Baran Topal


May 2024
M T W T F S S
« Feb    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories


session vs. viewstate in an old browser

baranbaran

I had some huge data that I need to cache in ASP.NET and it was weird specification that the customer required to use an old IE..

This weird choice “paid off” when I used sessions as the session approach was not really working when the user logged into same browser and does the same stuff on 2 separate tabs.

And this site explains the reason and the symptoms:

http://geekswithblogs.net/ranganh/archive/2009/04/17/asp.net-session-state-shared-between-ie-tabs-and-ie8.aspx

So, viewstates..

Years ago, I had a case that I needed to enable the viewstate for ALL my controls and i need actually view state for postbacks, but I need to minimize the viewstate, disabling it for buttons maybe? or a static content. I was wondering the failsafe strategy in this.

Then I found myself that I was fighting a losing battle here – there is a solution and its called asp.net MVC – If your using webforms – its going to bloat, unfortunately… thats the trade off… your best bet is to manually disable view state one by one, but then you might as well use plain old html elements… Even with no controls on a page you’re going to get some nice viewstate on the page.
Zipping content is like anything else on the client, if it can gzip its going to, you wouldn’t do your own manual zipping of html? also viewstate is encrypted so Im guessing compression ratio is not going to be appealing.