Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GridView and EnabledViewState
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01341995
Message ID:
01342071
Views:
19
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>Do you know how a GridView "remembers" the page it is currently displayed? I set EnabledViewState property to false for almost all of my GridViews, the page become to load quicker, I think, but on a postback it doesn't automatically re-set to the first page, but shows the page last used. I can fix this behavior in code if needed, but was just curious why and how it is saved.
>
>Thanks a lot in advance.

ASP.NET controls use viewstate to maintain information about the "state" of the page. They're nothing more than variables that get serialized and the embedded in the rendered page as hidden form variables. During a postback these variables are then deserialized and used. When you disable the viewstate, pages can be quicker because you're not transferring these hidden variables from the server to the browser (and back again) on each hit. For some controls, this can actually be a lot of information. However, like you've found out, there is a reason viewstate is being used. When you shut it off you give up a bit of the functionality that is dependent on it.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform