I am using viewstate in my webparts

ViewState["CurrentPageNo"] = 22;

But this is not working on my production environment as enableview state is false in web.config. How can we enable it on pagelevel without modifying web.config?

1 Answer 1


You can try to enable it in the Master page and see if it works. something like this

<@Page EnableViewState="true" />


But it is really recomendid to do this via web.config.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.