Click here to Skip to main content
15,171,576 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 2: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
   
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.
Espen Harlinn 3-Jan-11 5:17am
   
That's odd..., I've done this on a number of occasions without trouble ...
   

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