aspx thread: System.Web.HttpException: The View State is invalid for this page and might be corrupted.
Hi ,
I am developing one web based application in DotNet environment.I am
facing a problem when navigating to from one page to another page with
href through Post method.While navigating I am getting
one "System.Web.HttpException" error at the destination page load. Can you
help me why this error is giving ?? I am also sending the required code I
have written below.
My functionality is like as below.
I am populating data from database into a asp:Repeater object with one
field with href.
The code as follows
<form1 id ="Form1" method ="post" runat ="server">
<table><tr><td>
<ASP:Repeater id="SearchResult" runat=server>
<HeaderTemplate>
<table width="550px" border="1" cellspacing="1" cellpadding="1"aign="left">
</HeaderTemplate>
<ItemTemplate>
<tr height="10px" style="BACKGROUND-COLOR: #ecf6ff">
<td height="10px" width="64px">
<a href ="javascript:ShowDetail('<%# Container.DataItem("COID")%
>')"><%# Container.DataItem("COID")%></a></td>
<td height="10px" width=259px><%# Container.DataItem("CONAME")%
></td></tr>
</ItemTemplate>
</ASP:Repeater>
</td>
<td><input type =hidden id =hidCOID value ="" ></td></tr></table>
</form>
The Javascript Where I have written navigation function as follows
function ShowDetail(coid)
{
document.Form1.hidCOID.value=coid
document.Form1.action="Form2.aspx"
document.Form1.submit()
}
After navigating to Form2 screen I am getting the error as follows even in
the case of viewstate as true or false
System.Web.HttpException: The View State is invalid for this page and
might be corrupted.
Please help me on this.