Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 help and support Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.


Go Back   Vista Forums > Vista Newsgroup Archive > Misc Newsgroups > .NET General

RB

Vista - Disable ViewState

 
 
09-10-2008   #1 (permalink)
MCM


 

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?

My System SpecsSystem Spec
09-10-2008   #2 (permalink)
Steven Cheng [MSFT]


 

RE: Disable ViewState

Hi MCM,

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

* at web.config <pages> level
* 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 <pages> level

* 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:
msdnmg@xxxxxx.

==================================================
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.





--------------------
Quote:

>From: =?Utf-8?B?TUNN?= <MCM@xxxxxx>
>Subject: Disable ViewState
>Date: Wed, 10 Sep 2008 07:56:18 -0700
Quote:

>
>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?
>
My System SpecsSystem Spec
09-15-2008   #3 (permalink)
MCM


 

RE: Disable ViewState

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:
Quote:

> Hi MCM,
>
> As for "disabling" ViewState, you can set "ViewState" at several different
> levels:
>
> * at web.config <pages> level
> * 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 <pages> level
>
> * 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:
> msdnmg@xxxxxx.
>
> ==================================================
> 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.
>
>
>
>
>
> --------------------
Quote:

> >From: =?Utf-8?B?TUNN?= <MCM@xxxxxx>
> >Subject: Disable ViewState
> >Date: Wed, 10 Sep 2008 07:56:18 -0700
>
Quote:

> >
> >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?
> >
>
>
My System SpecsSystem Spec
09-15-2008   #4 (permalink)
Steven Cheng [MSFT]


 

RE: Disable ViewState

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:
msdnmg@xxxxxx.

==================================================
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.


--------------------
Quote:

>From: =?Utf-8?B?TUNN?= <MCM@xxxxxx>
>Subject: RE: Disable ViewState
>Date: Mon, 15 Sep 2008 14:59:01 -0700
Quote:

>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:
>
Quote:

>> Hi MCM,
>>
>> As for "disabling" ViewState, you can set "ViewState" at several
different
Quote:
Quote:

>> levels:
>>
>> * at web.config <pages> level
>> * 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.
Quote:
Quote:

>>
>> 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 <pages> level
>>
>> * 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
Quote:
Quote:

>> suggestions about how we can improve the support we provide to you.
Please
Quote:
Quote:

>> 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:
>> msdnmg@xxxxxx.
>>
>> ==================================================
>> Get notification to my posts through email? Please refer to
>>
http://msdn.microsoft.com/en-us/subs...#notifications.
Quote:
Quote:

>>
>> Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
Quote:
Quote:

>> where an initial response from the community or a Microsoft Support
>> Engineer within 1 business day is acceptable. Please note that each
follow
Quote:
Quote:

>> up response may take approximately 2 business days as the support
>> professional working with you may need further investigation to reach
the
Quote:
Quote:

>> most efficient resolution. The offering is not appropriate for
situations
Quote:
Quote:

>> that require urgent, real-time or phone-based interactions or complex
>> project analysis and dump analysis issues. Issues of this nature are
best
Quote:
Quote:

>> handled working with a dedicated Microsoft Support Engineer by
contacting
Quote:
Quote:

>> Microsoft Customer Support Services (CSS) at
>>
http://support.microsoft.com/select/...tance&ln=en-us.
Quote:
Quote:

>> ==================================================
>> This posting is provided "AS IS" with no warranties, and confers no
rights.
Quote:
Quote:

>>
>>
>>
>>
>>
>> --------------------
Quote:

>> >From: =?Utf-8?B?TUNN?= <MCM@xxxxxx>
>> >Subject: Disable ViewState
>> >Date: Wed, 10 Sep 2008 07:56:18 -0700
>>
Quote:

>> >
>> >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?
>> >
>>
>>
>
My System SpecsSystem Spec
09-16-2008   #5 (permalink)
MCM


 

RE: Disable ViewState

Ok. Thanks.

"Steven Cheng [MSFT]" wrote:
Quote:

> 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:
> msdnmg@xxxxxx.
>
> ==================================================
> 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.
>
>
> --------------------
Quote:

> >From: =?Utf-8?B?TUNN?= <MCM@xxxxxx>
> >Subject: RE: Disable ViewState
> >Date: Mon, 15 Sep 2008 14:59:01 -0700
>
Quote:

> >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:
> >
Quote:

> >> Hi MCM,
> >>
> >> As for "disabling" ViewState, you can set "ViewState" at several
> different
Quote:
Quote:

> >> levels:
> >>
> >> * at web.config <pages> level
> >> * 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.
Quote:
Quote:

> >>
> >> 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 <pages> level
> >>
> >> * 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
Quote:
Quote:

> >> suggestions about how we can improve the support we provide to you.
> Please
Quote:
Quote:

> >> 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:
> >> msdnmg@xxxxxx.
> >>
> >> ==================================================
> >> Get notification to my posts through email? Please refer to
> >>
> http://msdn.microsoft.com/en-us/subs...#notifications.
Quote:
Quote:

> >>
> >> Note: The MSDN Managed Newsgroup support offering is for non-urgent
> issues
Quote:
Quote:

> >> where an initial response from the community or a Microsoft Support
> >> Engineer within 1 business day is acceptable. Please note that each
> follow
Quote:
Quote:

> >> up response may take approximately 2 business days as the support
> >> professional working with you may need further investigation to reach
> the
Quote:
Quote:

> >> most efficient resolution. The offering is not appropriate for
> situations
Quote:
Quote:

> >> that require urgent, real-time or phone-based interactions or complex
> >> project analysis and dump analysis issues. Issues of this nature are
> best
Quote:
Quote:

> >> handled working with a dedicated Microsoft Support Engineer by
> contacting
Quote:
Quote:

> >> Microsoft Customer Support Services (CSS) at
> >>
> http://support.microsoft.com/select/...tance&ln=en-us.
Quote:
Quote:

> >> ==================================================
> >> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Quote:
Quote:

> >>
> >>
> >>
> >>
> >>
> >> --------------------
> >> >From: =?Utf-8?B?TUNN?= <MCM@xxxxxx>
> >> >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?
> >> >
> >>
> >>
> >
>
>
My System SpecsSystem Spec
 

Thread Tools


Similar Threads for: Disable ViewState
Thread Forum
ViewState vs. Database .NET General
Disable F8 during startup - Disable Advanced startup options scree Vista security
Can I Disable UAC? Vista account administration
is there any way to disable... Vista hardware & devices
Re: Disable UAC Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51