T
Tony Hedge
Hello,
I hope some one can answer this for me.
I am using .NET version 1.0 on Windows 2000Pro and I am
getting an error when doing a form submit from an HTML
control. Please look at the following brief code example:
I have two aspx file WebForm1.aspx and WebForm2.aspx.
WebForm1 has the following elements:
....
<form id="Form1" method="post" action="" runat="server">
<input id="h1" name="h1" value="1" type="hidden">
<input type="button" id="btnGo" name="btnGo" value="GO"
onclick="CallGo()">
</form>
....
This is the code for function CallGo:
<script language="javascript">
function CallGo()
{
document.forms('Form1').action = 'WebForm2.aspx';
document.forms('Form1').submit();
}
</script>
I added no code to the code-behind page for WebForm1.
When I click on button GO, the client side CallGo function
exectues but I get the following error at the submit point:
'The View State is invalid for this page and might be
corrupted.'
However, if I take out the runat=server attribute from the
form element above, everything works as expected.
I need to use the runat=server attribute on the form
element because I will be adding code in the code-behind
page for it. Can anyone explain how to get around this
error?
Much appreciated!
Tony
I hope some one can answer this for me.
I am using .NET version 1.0 on Windows 2000Pro and I am
getting an error when doing a form submit from an HTML
control. Please look at the following brief code example:
I have two aspx file WebForm1.aspx and WebForm2.aspx.
WebForm1 has the following elements:
....
<form id="Form1" method="post" action="" runat="server">
<input id="h1" name="h1" value="1" type="hidden">
<input type="button" id="btnGo" name="btnGo" value="GO"
onclick="CallGo()">
</form>
....
This is the code for function CallGo:
<script language="javascript">
function CallGo()
{
document.forms('Form1').action = 'WebForm2.aspx';
document.forms('Form1').submit();
}
</script>
I added no code to the code-behind page for WebForm1.
When I click on button GO, the client side CallGo function
exectues but I get the following error at the submit point:
'The View State is invalid for this page and might be
corrupted.'
However, if I take out the runat=server attribute from the
form element above, everything works as expected.
I need to use the runat=server attribute on the form
element because I will be adding code in the code-behind
page for it. Can anyone explain how to get around this
error?
Much appreciated!
Tony