Prevent data transfer from ASP.NET view to querystring via GET form

I believe that I disabled the view state on all controls, as well as on the page itself, but the __viewstate and __eventvalidation parameters are still in the query line.

Any ideas on what to check and / or change? Is there something I may not know about the viewstate (very likely) that causes the view state to be passed as a GET method?

Thanks Kevin

Edit:

I use the GET method because I would like the form results to be tab-bound, linked, etc. This is not possible for Post only because the form data is not passed to the URL.

And I prefer the viewstate / eventvalidation not to show just for aesthetic reasons.

+3
source share
1 answer

Removing an attribute runat="server"from a form tag will effectively remove the hidden viewstate and eventvalidation fields. But then you cannot use the server controls on the page, so I doubt what you want to do.

Are you sure the __viewstate and __eventvalidation fields will appear in your request? That sounds a little weird.

Send some code and let us know why you want to delete hidden fields in the first place. If you turn off the pagestate viewstate, the values ​​in the hidden fields should remain relatively small ...

+2
source

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


All Articles