ASP.NET Viewstate Optimization/Analyzing Tools
Are there any tools for analyzing the controls in an ASP.NET page, to make sure they do not need to use the viewstate?
We are trying to optimize a website written in C# as开发者_开发知识库p.net 3.5 , and wanted to see if a tool would automatically analyze the project and make recommendations.
I'm not familiar with tools specifically for analyzing the ViewState of different elements on an asp.net page.
I almost never save ViewState of table elements like DataGrid or GridView, since these element have HUGE ViewState objects that aren't neede most of the time. You need to think logically which element's state you need to save for the user.
You can also enable 'Trace' (Enabling Trace), proxy sniffer tools like Fiddler and different performance add-ons (like YSlow for FireFox) to see how much data you're sending to the server on each call and how much you're getting back, where the time is being taken up mostly, and try to see which data isn't necessary.
A good article on improving performance of an asp.net web application : http://www.dotnetfunda.com/articles/article45.aspx
The only one I know of is a FireFox extension called Viewstate size, which displays the size of the viewstate in the bottom status bar in the browser. You can see the size on the unmodified page, make some code changes and refresh the browser to see if your changes made any difference in the viewstate size.
精彩评论