I have a website and whenever I try to add a form with an on button click event to a page I get,
The state information is invalid for this page and might be corrupted.
But it only happens sometimes.
I have tried this.EnableViewState = true; and this.EnableViewState = false; and it makes no difference.
Why does it sometimes work and other times not work and how can I fix it?
I’m never using Webforms again!
I’ve tried everything to stop the _VIEWSTATE issue and to no avail!
In this instance I was lucky and have created a work around.
The back end to the blog is all MVC4 and was easy to build. The front end is now a blog post, with published comments done in Webforms under it and I’ve included an MVC4 comment box in an iFrame.
For this project, all comments have to be moderated, so the comments are not available to view right away anyway, the user gets a return RedirectToAction(“CommentResponse”); page and if I like what they have said their comment will be available to view next time they come to the site.
I think that will work for them and just to re state; I’m never using Webforms again, AyKarsi, I don’t like iFrames either but it works and your initial comment was the correct answer!