Preventing ASP.NET viewstate from being transmitted in querystring via form GET

I believe I have disabled the view state on all controls as well as the page itself, but the querystring still contains the __viewstate and __eventvalidation parameters.

Any ideas on what to check and/or change? Is there something I may not know about viewstate (very likely) that is causing the view state to be transmitted in the form GET method?

Thanks,
Kevin

Edit:

I am using the GET method because I would like the form results to be able to be bookmarked, linked, etc. This is not possible with Post simply because the form data isn’t transmitted via the URL.

And I prefer the viewstate/eventvalidation not shown simply for aesthetic reasons.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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

Are you sure the __viewstate and __eventvalidation fields appear in your querystring?? That does sound a bit strange.

Post some code and tell us why you want to remove the hidden fields in the first place. If you disable viewstate on a page-level, the values in the hidden fields should remain relatively small…


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x