467,912 Members | 1,517 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,912 developers. It's quick & easy.

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
  • viewed: 2002
Share:
4 Replies
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Homa | last post: by
1 post views Thread by Rhodri | last post: by
3 posts views Thread by Stan | last post: by
7 posts views Thread by Jo Inferis | last post: by
1 post views Thread by Julien Grossiord | last post: by
7 posts views Thread by George Ter-Saakov | last post: by
6 posts views Thread by sri_san | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.