Why is there a viewstate on my MVC 2.0 page?

Sorry if this is a stupid question, but I thought that all of this with MVC was that there was no viewstate (or the choice not to have a viewstate), but when I create my page, I have this:

<div class="aspNetHidden"> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNDMyNDU0NjAzZGRjlqkQNPIdYgfiR4aOw7np3SRI0LRCffrTkaOLWtatvA==" /> 

How can I get rid of it?

+4
source share
1 answer

Locate any runat="server" tag on all of your pages (wizard, views, controls, ...) and delete it (especially things like <form runat="server"> ). These attributes should no longer be present in an ASP.NET MVC application.

+3
source

Source: https://habr.com/ru/post/1343491/


All Articles