System.Web.HttpException: The View State is invalid for this page and might be corrupted.
-
I want to post the form contents to another page. This function would be called from a hyperlink. When we click that link it should do the form posting and submit. function post() { document.frmLogin.action = "../common/FormRedirector.aspx"; document.frmLogin.submit(); } when i do this i am getting System.Web.HttpException: The View State is invalid for this page and might be corrupted. Cheers, Venkatraman Kalyanam Chennai - India "Being Excellent is not a skill, it is an attitude"
-
I want to post the form contents to another page. This function would be called from a hyperlink. When we click that link it should do the form posting and submit. function post() { document.frmLogin.action = "../common/FormRedirector.aspx"; document.frmLogin.submit(); } when i do this i am getting System.Web.HttpException: The View State is invalid for this page and might be corrupted. Cheers, Venkatraman Kalyanam Chennai - India "Being Excellent is not a skill, it is an attitude"
Venkatraman Hi, Part of the form that you are sending contains the view state of the current page (the
__ViewState
hidden field), for thePostBack
machinery. While page is load on the server side the ASP.NET read the viewstate hidden field to set the controls value. Your problem is that the target page can’t translate the__viewstate
field to the target page controls and you get your error. To overcome it try to: 1) Remove viewstate, if you don’t use it. 2) Create new form with javascript that will send the necessary fields. 3) User server side event to catch the click. Use Server.Transfer to move into the target page. Send the Form data view Context -
Venkatraman Hi, Part of the form that you are sending contains the view state of the current page (the
__ViewState
hidden field), for thePostBack
machinery. While page is load on the server side the ASP.NET read the viewstate hidden field to set the controls value. Your problem is that the target page can’t translate the__viewstate
field to the target page controls and you get your error. To overcome it try to: 1) Remove viewstate, if you don’t use it. 2) Create new form with javascript that will send the necessary fields. 3) User server side event to catch the click. Use Server.Transfer to move into the target page. Send the Form data view ContextHey Natty Gur, I also get this error sometimes. But I am not able to reproduce it and is quite vagarious in its occurence. Normally a Rebuild All solves the problem. Does this because, Building and Deploying [Debug] causes Sessions to reset and ViewStates to get set to null? Deepak Kumar Vasudevan http://deepak.portland.co.uk/