Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is it possible to make the viewstate false of whole page including all controls at a time.I mean I don't want to set enableviewstate="false" for all controls..In the page directive of the aspx page I have made enableviewstate="false" but still viewstate of all the controls of the is enabled..

And what the EnableViewState="False"actually works within Page directive.
Posted
Updated 31-Dec-10 1:58am
v2
Comments
Hiren solanki 31-Dec-10 8:50am    
May I know by disabling viewstate what you want to achieve ?

You can use something like this:
aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContentPage.aspx.cs" Inherits="AjaWorks.Control.Centre.Web.ContentPage" EnableViewState="False" %>


You will not be able to completely get rid of the viewstate, but setting EnableViewState to false should reduce it significantly

Regards
 
Share this answer
 
v2
Comments
Hiren solanki 31-Dec-10 7:50am    
A very obvius answer (up)
Espen Harlinn 31-Dec-10 7:53am    
Thanks
Rounak Hasan 31-Dec-10 7:56am    
I have check this..It is not working..
Espen Harlinn 31-Dec-10 7:59am    
You will not be able to completely get rid of the viewstate, but setting EnableViewState to false should reduce it significantly
Rounak Hasan 3-Jan-11 4:26am    
I have checked it.For Asp.net 4.0 it is working fine but for asp.net 3.5 it is not working.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900