Reputation: 30855
Is there a reliable method for viewing the size of the viewstate on any given postback?
Upvotes: 7
Views: 6918
Reputation: 1829
In Google Chrome you can use Chrome Viewstate or Viewstate indicator modules
Upvotes: 4
Reputation: 1830
Trace could be overkill sometimes. You can add this javascript to the page see quickly see how the ViewState grows as you click around.
<script type="text/javascript">
alert('Viewstate is now ' + $('#__VIEWSTATE').val().length + ' bytes.');
</script>
Upvotes: 6
Reputation: 9193
You have a few options:
I found this article quite useful "Determining an ASP.NET Page's View State Footprint" and it covers the options mentioned above.
However what I ended up doing when I needed to look at the viewstate size etc. of a application I was brought in to work on, was to use a tool called "ASP.NET ViewState Helper". What I liked about that tool was that I could run it as a standalone executable, no installation of plugins required and no changing of the code required.
The drawback is that it only works for IE but in my case that was fine.
Upvotes: 1
Reputation: 5823
I would recommend using FireFox addon called "Viewstate Size". Quick, simple and convenient.
https://addons.mozilla.org/en-US/firefox/addon/5956/
Upvotes: 11
Reputation: 13125
To view it in the page at the bottom of each request you can enable page level tracing like:
<%@ Page Trace="true" %>
You can read more about this technique here:
Upvotes: 6
Reputation: 1378
Upvotes: 7