473,804 Members | 3,532 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

turning off viewstate didn't work in web.config

I want to turn off viewstate for an application. I added the code below
into my web.config, but I'm still getting lotsa viewstate data in my hidden
form field:

<configuratio n>
<appSettings>
<Pages EnableViewState ="false" />
</appSettings>

.....
</configuration>

--
_____
DC G
Nov 18 '05 #1
2 1641
Off the top of my head, I believe the <pages> (case is important)
setting goes in the <system.web> section, and *not* in the <appSettings>
section.

FYI, even when you turn off view state on all pages, you will still get
*some* (albeit, very little). For more on why, see:
http://scottonwriting.net/sowblog/posts/1608.aspx

DC Gringo wrote:
I want to turn off viewstate for an application. I added the code below
into my web.config, but I'm still getting lotsa viewstate data in my hidden
form field:

<configuratio n>
<appSettings>
<Pages EnableViewState ="false" />
</appSettings>

....
</configuration>

--

Scott Mitchell
mi******@4guysf romrolla.com
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla. com!
Nov 18 '05 #2
Thank you. The problems turned out to be the "enableViewStat e" had an
erroneous capital "E" as well as an extra appsettings key...

I copied this straight out of the VS.NET help which has the capital E:

Disabling ViewState

In the example above, I disabled ViewState for the grid by setting its
EnableViewState property to false. ViewState can be disabled for a single
control, for an entire page, or for an entire application, as follows:

Per control (on tag)<asp:datagr id EnableViewState ="false" . />
Per page (in directive)<%@ Page EnableViewState ="False" . %>
Per application (in web.config)<Pag es EnableViewState ="false" . />
_____
DC G

"Scott Mitchell [MVP]" <mi******@4guys fromrolla.com> wrote in message
news:41******** ******@4guysfro mrolla.com...
Off the top of my head, I believe the <pages> (case is important)
setting goes in the <system.web> section, and *not* in the <appSettings>
section.

FYI, even when you turn off view state on all pages, you will still get
*some* (albeit, very little). For more on why, see:
http://scottonwriting.net/sowblog/posts/1608.aspx

DC Gringo wrote:
I want to turn off viewstate for an application. I added the code below
into my web.config, but I'm still getting lotsa viewstate data in my hidden form field:

<configuratio n>
<appSettings>
<Pages EnableViewState ="false" />
</appSettings>

....
</configuration>

--

Scott Mitchell
mi******@4guysf romrolla.com
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla. com!

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1470
by: Jason | last post by:
Can anybody help on the following error : The viewstate is invalid for this page and might be corrupted. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: The viewstate is invalid for this page and might be corrupted.
2
1648
by: Amir | last post by:
Hi everyone How can I expand the size of an aspx page's viewstate or all pages' viewstate? thanks in advanced
9
4931
by: Jamie | last post by:
I am receiving an Invalid ViewState error after posting back to the same page twice. Consistently the error occurs after the second postback and not after the first. I have looked into creating a static machinekey in the machine.config and that did not help. I believe that issue only occurred when there was an inconsistent viewstate error. The error I am faced with consistently occurs. Are there any known problems with the ViewState...
8
3632
by: Mark A. Sam | last post by:
Hello I am working locally with Visual Web Developer 2005 Express. Before I even installed it, the information from Microsoft was that you could FTP it to a remote site and it should work. The site I FTP'd to has .Net Framework 2.0 installed. I got this error when I tried to open the site: Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details...
2
1573
by: Jeremy Chapman | last post by:
This is odd behavior. In my aspnet 2.0 app (basic app, nothing out of the ordinary here), if I am using my iPAQ handheld device and I hit the refresh button on my page, I get an error "Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster." The interesting thing...
5
14075
by: russell.lane | last post by:
I'm getting the much-hated "validation of viewstate MAC failed" error. This is on an ASP.Net 2.0 app running in IIS with IE 6+ as the browser. The full error text is: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKeyconfiguration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. The app *is not* running in a cluster or...
11
8698
by: =?Utf-8?B?R2lsZXMgUGFwd29ydGg=?= | last post by:
I seem to be getting this error message all of a sudden on one of my web apps: System.Web.Configuration.MachineKey.GetDecodedData(Byte buf, Byte modifier, Int32 start, Int32 length, Int32& dataLength) +195 System.Web.UI.LosFormatter.Deserialize(String input) +60 System.Web.UI.LosFormatter.Deserialize(String input) +117 System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +102
6
1593
by: Rain | last post by:
Hi, I noticed the other day when I was trying to optimise the traffic on a particular web page that it had significant viewstate even though I had turned it off for most of the controls. So in a bold step I decided to attempt to set viewstate on the form itself off which had a massive impact on the viewstate like 80K to 15k. So my question is what is the significance of turning off the viewstate for the form and what information...
4
2292
by: =?Utf-8?B?TUNN?= | last post by:
I am trying to disable ViewState at the application level. I have the following line in my web.config: <pages enableViewState="false"></pages> But it is not working. What can I do?
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9582
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10580
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9157
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3821
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.