I saw that this question asked a lot, but none of the questions or answers that I saw seem to affect my problem. As the name implies, I always get a nice viewstate error check.
My companyβs site is hosted on Amazon EC2, so as far as I know, this is not a web farm, as this is the only page that has a problem.
We have a simple feedback page that looks great, and all the elements on the page work just fine, including leaving new reviews. However, the Check Flag button generates a viewstate error when clicked.
The actual code that runs when the button is clicked is as follows:
protected void btnFlagReview_Click(object sender, EventArgs e) { try { LinkButton btn = (LinkButton)sender; int id = Int32.Parse(btn.Attributes["rid"]); testimonials.updateModerated(false, id); MailMessage mail = new MailMessage(); mail.To.Add(" oursupport@emailaddress.com "); mail.From = new MailAddress(" ourwebmaster@emailaddress.com "); mail.Subject = "A review has been flagged for moderation"; string Body = "A user review has been flagged for moderation. Please Approve/Delete this review in the Admin Panel. "; mail.Body = Body; SmtpClient smtp = new SmtpClient(); try { smtp.Send(mail); } catch (SmtpException ex) { if (ex.StatusCode == SmtpStatusCode.InsufficientStorage) smtp.Send(mail);
The code from the actual button is as follows:
<asp:LinkButton ID="btnFlagReview" OnClick="btnFlagReview_Click" rid='<%# Eval("testimonialID") %>' runat="server">flag</asp:LinkButton>
I even tried the solution I found on other questions on the Internet, and here, like changing the validateRequest, enableEventValidation and viewStateEncryptionMode pages to see if they will work.
I am at a loss, given that the action of the flag review is so simple compared to what we do. Any help would be greatly appreciated.
source share