System.Web.HttpException: The viewstate is invalid for this pageand might be corrupted

G

Gvnn

Hi,
I've a little problem, i've an asp.net page, with a runat server form,
like this:

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="index.aspx.vb" Inherits="indexGstPro"%>
<HTML>
<HEAD>
</HEAD>
<body>
<form runat="server" method="post" id="indexGstPro">
</form>
</body>
</HTML>

now i want to go to another page by clicking a link, i've made this
javascript code:

document.indexGstPro.action = 'page.aspx';
document.indexGstPro.submit();

The page submits correctly, but the page i want to go return me this error:
System.Web.HttpException: The viewstate is invalid for this page and
might be corrupted

How can i solve the problem?

Gvnn
 
J

Jim Cheshire [MSFT]

Gvnn,

ASP.NET pages do not support submission to a different page. If you need
to do this, you will need to programmatically disable Viewstate for the
page prior to posting back. Here's what I mean.

document.indexGstPro.__VIEWSTATE.disabled = true;
document.indexGstPro.action = 'page.aspx';
document.indexGstPro.submit();

Jim Cheshire [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top