Mridul Raj Mridul Raj - 1 year ago 94
ASP.NET (C#) Question

How to disable viewstate for aspx page?

I need to completely disable viewstate for an aspx page inside my web application. I have gone through different blogs and what I understand is that we must set

<%@ Page EnableViewState="false" ...%>
. But this is not working. My question is, wheteher this is enough to disable viewstate for all the controls inside the page? Or Should i make any additional modifications? Please specify if any. I dont want viestate enabled for even a single control inside the aspx page

Answer Source

I think the quotes should be:


Apart from that, if you are still seeing the hidden fields then they are used by ASP.Net. You may see:

Page.EnableViewState Property

Even if EnableViewState is false, the page might contain a hidden view state field that is used by ASP.NET to detect a postback.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download