473,406 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Disable ViewState

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?
Sep 10 '08 #1
4 2263
Hi MCM,

As for "disabling" ViewState, you can set "ViewState" at several different
levels:

* at web.config <pageslevel
* at @page directive level, this can override the web.config level
* at control's level, this rely on whether the page's viewstate is enabled.

As for the problem behavior you encountered, how did you get that the
ViewState is not disabled? I've performed a simple test as below

*disable viewstate at web.config <pageslevel

* create a new page and put a Label on the page

I can find that the Label's ViewState is not available.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: =?Utf-8?B?TUNN?= <MC*@newsgroup.nospam>
Subject: Disable ViewState
Date: Wed, 10 Sep 2008 07:56:18 -0700
>
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?
Sep 15 '08 #2
When I view the source of the page output, there is still a hidden field
being generated for ViewState and it does not have an empty value.
"Steven Cheng [MSFT]" wrote:
Hi MCM,

As for "disabling" ViewState, you can set "ViewState" at several different
levels:

* at web.config <pageslevel
* at @page directive level, this can override the web.config level
* at control's level, this rely on whether the page's viewstate is enabled.

As for the problem behavior you encountered, how did you get that the
ViewState is not disabled? I've performed a simple test as below

*disable viewstate at web.config <pageslevel

* create a new page and put a Label on the page

I can find that the Label's ViewState is not available.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?TUNN?= <MC*@newsgroup.nospam>
Subject: Disable ViewState
Date: Wed, 10 Sep 2008 07:56:18 -0700

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?

Sep 15 '08 #3
Thanks for your reply MCM,

As for the hidden "__VIEWSTATE" html hidden field, it is the expected
behavior that ASP.NET page still output it even if you disable viewstate.
This is because this hidden field is not only used for storing page or
control's ViewState data. It also contains some data for identifying the
current status(such as status between multiple postback) so that the
server-side can differenitate each request from the client-side for the
same page.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?TUNN?= <MC*@newsgroup.nospam>
Subject: RE: Disable ViewState
Date: Mon, 15 Sep 2008 14:59:01 -0700
>When I view the source of the page output, there is still a hidden field
being generated for ViewState and it does not have an empty value.
"Steven Cheng [MSFT]" wrote:
>Hi MCM,

As for "disabling" ViewState, you can set "ViewState" at several
different
>levels:

* at web.config <pageslevel
* at @page directive level, this can override the web.config level
* at control's level, this rely on whether the page's viewstate is
enabled.
>>
As for the problem behavior you encountered, how did you get that the
ViewState is not disabled? I've performed a simple test as below

*disable viewstate at web.config <pageslevel

* create a new page and put a Label on the page

I can find that the Label's ViewState is not available.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments
and
>suggestions about how we can improve the support we provide to you.
Please
>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.
>>
Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
>where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
>up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach
the
>most efficient resolution. The offering is not appropriate for
situations
>that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are
best
>handled working with a dedicated Microsoft Support Engineer by
contacting
>Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
>================================================= =
This posting is provided "AS IS" with no warranties, and confers no
rights.
>>


--------------------
>From: =?Utf-8?B?TUNN?= <MC*@newsgroup.nospam>
Subject: Disable ViewState
Date: Wed, 10 Sep 2008 07:56:18 -0700
>
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?

Sep 16 '08 #4
Ok. Thanks.

"Steven Cheng [MSFT]" wrote:
Thanks for your reply MCM,

As for the hidden "__VIEWSTATE" html hidden field, it is the expected
behavior that ASP.NET page still output it even if you disable viewstate.
This is because this hidden field is not only used for storing page or
control's ViewState data. It also contains some data for identifying the
current status(such as status between multiple postback) so that the
server-side can differenitate each request from the client-side for the
same page.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?TUNN?= <MC*@newsgroup.nospam>
Subject: RE: Disable ViewState
Date: Mon, 15 Sep 2008 14:59:01 -0700
When I view the source of the page output, there is still a hidden field
being generated for ViewState and it does not have an empty value.
"Steven Cheng [MSFT]" wrote:
Hi MCM,

As for "disabling" ViewState, you can set "ViewState" at several
different
levels:

* at web.config <pageslevel
* at @page directive level, this can override the web.config level
* at control's level, this rely on whether the page's viewstate is
enabled.
>
As for the problem behavior you encountered, how did you get that the
ViewState is not disabled? I've performed a simple test as below

*disable viewstate at web.config <pageslevel

* create a new page and put a Label on the page

I can find that the Label's ViewState is not available.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments
and
suggestions about how we can improve the support we provide to you.
Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.
>
Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach
the
most efficient resolution. The offering is not appropriate for
situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are
best
handled working with a dedicated Microsoft Support Engineer by
contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
>


--------------------
From: =?Utf-8?B?TUNN?= <MC*@newsgroup.nospam>
Subject: Disable ViewState
Date: Wed, 10 Sep 2008 07:56:18 -0700


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?



Sep 16 '08 #5

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

Similar topics

2
by: Homa | last post by:
Hi, I have a datalist with linkbuttons embedded within. In order for the onClick event to fire, I need to have EnableViewState = true. But since there are quite a lot of data, simply enable...
1
by: Rhodri | last post by:
Hi all I have a datagrid which can display upto 20,000 records and the viewstate gets very big. I have tried turning of viewtate using EnableViewState = false both on the parent page and on the...
3
by: Stan | last post by:
Dispite the fact that ViewState="false" at the page level, and all controls have viewstate disabled, ViewState is still on the page (<input type="hidden" name="__VIEWSTATE" value="..." /> Why...
2
by: Fluxray | last post by:
--Background: I have a webform including a datagrid. The datagrid is using template. Its ItemTemplate is used to display a look-up-table with labels. its EditItemTemplate is used to edit a row in...
7
by: Jo Inferis | last post by:
For reasons that are unlikely to become clear at the moment, I have a page with some validation controls on it which opens a dialog. The dialog does *stuff* and then closes with a call to : ...
1
by: Julien Grossiord | last post by:
Hello, As I do not need it, I would like to disable ViewState on my server but even if I use <pages enableViewState="false"> in web.config or <%@ Page EnableViewState="false" .... %> in my...
4
by: Umut Tezduyar | last post by:
I want to get rid of the hidden field _VIEWSTATE. I tried these: I tried to disable ViewState property. I tried to override Page's RegisterHiddenField method. I tried to override Page's...
7
by: George Ter-Saakov | last post by:
on my page I have <%@ Page Language="C#" EnableViewState="false"%> But in HTML i still see __VIEWSTATE hidden variable. <form name="form1" method="post" action="......" id="form1"> <div>...
6
by: sri_san | last post by:
Hello, I have a aspx page in which I would like to eliminate all of the hidden variables as this page would be imported to an email client and the hidden controls are usually rendered in the mail...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.