473,395 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Submit form

I have page search.asp. When I click button, I submit form with script:

form1.action="searchResults.aspx"
form1.submit

On page searchResults.aspx I get the following error message:

The viewstate is invalid for this page and might be corrupted.

Does anybody know why?

Thank you,
Simon
Nov 18 '05 #1
3 1206
To pass the current submit to another page use Server.Transfer method, which
will submit the current page and will pass the request to another page
Is there any special reason to do it like your way ?

Reagrds,
Martin

"simon" <si*********@stud-moderna.si> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
I have page search.asp. When I click button, I submit form with script:

form1.action="searchResults.aspx"
form1.submit

On page searchResults.aspx I get the following error message:

The viewstate is invalid for this page and might be corrupted.

Does anybody know why?

Thank you,
Simon

Nov 18 '05 #2

"simon" <si*********@stud-moderna.si> wrote in message news:uW**************@TK2MSFTNGP12.phx.gbl...
I have page search.asp. When I click button, I submit form with script:

form1.action="searchResults.aspx"
form1.submit

On page searchResults.aspx I get the following error message:

The viewstate is invalid for this page and might be corrupted.

Does anybody know why?

Thank you,
Simon


I guess it is because you submit (probably via POST) to an aspx:
that aspx then expects a "postback", so tries to read the viewstate,
which normally is sent via a hidden input.
That input is not present (or not valid), therefore you get this error.

There is a way around this: you can set the directive
<%@ Page EnableViewStateMac="false" %>
in your aspx file.

I noticed you are trying to post from an asp to an aspx. (or is that a typo?)
The "usual" way for asp.net is to have an aspx page post to itself.
(then you won't have those viewstate problems)

Hans Kesting
Nov 18 '05 #3
Check out this faq,
http://www.extremeexperts.com/Net/FA...isCorrupt.aspx

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

"simon" <si*********@stud-moderna.si> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
I have page search.asp. When I click button, I submit form with script:

form1.action="searchResults.aspx"
form1.submit

On page searchResults.aspx I get the following error message:

The viewstate is invalid for this page and might be corrupted.

Does anybody know why?

Thank you,
Simon

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt | last post by:
Can form.submit() submit another form? In the following example, in page1.asp, it is fine to submit the current form: form1.submit(), and and I could see the value "Joe" in page2.asp. However, if I...
2
by: Terence Parker | last post by:
How does one go about submitting a form with a link - but submitting it to a new window AND to a page different to that described within the action="" option of the <form> tag? Say, for example,...
4
by: Sarah | last post by:
Hi all. I have a form, and several text and image links on it that should submit the form with different actions. I prepared a simple page with just the code that's not working. PROBLEM:...
15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
6
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
8
by: horos | last post by:
hey all, Ok, a related question to my previous one on data dumpers for postscript. In the process of putting a form together, I'm using a lot of placeholder variables that I really don't care...
5
by: rjames.clarke | last post by:
I have the following. $result=mysql_query($sql); $nrows=mysql_num_rows($result); for ($i=0;$i<$nrows;$i++) { $row_array=mysql_fetch_row($result); echo "<form name='testform'...
5
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input...
10
by: ljlolel | last post by:
So.. I have a form that submits to an ASP.net site made in C-sharp. The ASP site is not mine, i do not have the server side code. When I submit from my form by pressing the Submit button, I get...
1
by: gbezas | last post by:
Hi All, I have added an event handler to redirect form.submit() to a newSubmit() method that I have defined (which does some additional processing before submitting the form). Additionally I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.