Rocky Singh
Rocky Singh

Reputation: 15430

Viewstate still coming on page source

In the page directive of my page I have set EnableViewState="false". But I am still seeing some viewstate on my page source with this field

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/...................................

How can I remove the view state completely. I am using .NET 4.

Upvotes: 0

Views: 337

Answers (3)

user1429080
user1429080

Reputation: 9166

What you're seeing is Control State. It cannot be turned off.

Upvotes: 1

walther
walther

Reputation: 13600

You can't, it's a feature of webforms. If you don't like this, use MVC instead.

Upvotes: 0

Ravi Gadag
Ravi Gadag

Reputation: 15861

try using ViewStateMode property , as you are using .net 4

ViewStateMode="Disabled"

check for these links

  1. Viewstate controling asp.net 4.0

Upvotes: 0

Related Questions