More Group Sites
School Rankings
Jobless Net
Better Home
Enviro++


Help | Subscribe/Unsubscribe | Rules | Other Group Sites: Better Education | Better Education Forum
Welcome Guest Search | Active Topics | Members | Log In | Register

Which asp.net controls impact view state size significantly? Options · View
hong
Posted: Friday, October 07, 2011 7:16:48 AM

Rank: Administration
Groups: Administration

Joined: 11/23/2008
Posts: 335
Points: 711
Location: Australia
In ASP.NET, the size of view state of controls is one of the important factors impacting page speed. For faster websites, we need to control the size by using view states only when necessary.

My asp.net website master page used to have more than 100 KB viewstate. I turned off the unnecessary view states of several asp.net controls and showed little effect until I disabled the view state of the asp.net menu control. My website menu hierarchy is quite large. That's why the size of the view state is so big. So when we investigate the size of view states, we need to look at the controls which have many data records, such as menu controls which have complicated hierarchy, gridview controls which have many rows and columns or drop down list which as many list items. Other controls like labels, hyperlinks or images don't have big size of view states.

Not only we can turn off the view state for individual asp.net controls, we can also disable view state on page or site level.

Disable view state for entire page:
In .aspx,
Code:
<%@ Page ... EnableViewState="false" %>


Completely disable view state for a page in .cs

Disable view state for entire site:
In web.config,
Code:
<system.web>
<pages enableViewState="false" />

Sponsor
Posted: Friday, October 07, 2011 7:16:48 AM
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

ASPNET Theme created by Boskone (Dan Ferguson)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.065 seconds.