469,148 Members | 1,390 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,148 developers. It's quick & easy.

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

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

Nov 17 '05 #1
3 1932
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
ja******@online.microsoft.com

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

--------------------
Date: Fri, 17 Oct 2003 14:46:30 +0200
From: Gvnn <in**@gvnn.it>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2X-Accept-Language: en-us, en
MIME-Version: 1.0
Subject: System.Web.HttpException: The viewstate is invalid for this page
and might be corrupted
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <eV*************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: 62.94.108.71
Lines: 1
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:184894
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

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


Nov 17 '05 #2
Check out this faq, this might help you
http://www.extremeexperts.com/Net/FA...isCorrupt.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Gvnn" <in**@gvnn.it> wrote in message
news:eV*************@TK2MSFTNGP12.phx.gbl...
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

Nov 17 '05 #3
Check out this faq, this might help you
http://www.extremeexperts.com/Net/FA...isCorrupt.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Gvnn" <in**@gvnn.it> wrote in message
news:eV*************@TK2MSFTNGP12.phx.gbl...
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

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by TS | last post: by
1 post views Thread by dima | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.