Dhilipkumar r

Dhilipkumar r

  • 1.5k
  • 100
  • 4.4k

Explicitly defining ViewState of a server

Feb 14 2017 9:32 AM
Is it possible to explicitly define viewstate into a hidden field of an aspx page?
 
I tried this and got error
Exception Details: System.Web.HttpException: The state information is invalid for this page and might be corrupted.
 
  1. <form name="Form1" method="post" action="" id="Form1" runat="server" >  
  2. <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPD..............XCny" />  
  3.   
  4. <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEdA..............ntw==" />  
the error doesn't come when I postback to javascript alert function without runat="server" in form. But when I add runat="server" and call C# button_Click(object sender,EventArgs e) I get the invalid state error
 
 
 thanks for any kind of help

Answers (1)