C
Cat
Suppose there are two pages X and Y. X,Y both uses the master page M,
and content area x, y.
X=M+x
Y=M+y
I want to post a form from X to Y. X is just an input form, so it
validate all the inputs in the JavaScript and the form's ACTION is set
to Y. But the problem is, that somehow the content area of X and Y are
surrounded with a FORM generated by ASP.NET. I think ASP.NET replaces
the content area with a FORM.
I created a form in the page x, but I think the form is somehow merged
with the form that is generated by ASP.NET. The form also adds a
_VIEWSTATE input, so when the form is posted this field is also
posted.
<form ...> <-ASP.NET generated one
<input type="hidden" name="_VIEWSTATE"...>
<form action="Y.aspx"...> <-I wrote
...
<input type="submit"/>
</form>
</form>
When the submit button is clicked it's not posted to Y.aspx, but the
form genereated by ASP.NET gets posted. I could replace the ACTION of
the ASP.NET generated form with JavaScript but the _VIEWSTATE causes
an exception when posted to another page.
I've searched MSDN and found a solution about posting to another page.
That page explained how to do it with controls like Button, Link and
so on. But in reality, we usually check form with JavaScript before
post. Posting the form with just a Button click is impractical.
How can I solve this situation? More specifically, I'd like to 1)
remove the auto-generated form for content area or 2)post only the
form I created not the outer form or 3) remove the _VIEWSTATE field.
and content area x, y.
X=M+x
Y=M+y
I want to post a form from X to Y. X is just an input form, so it
validate all the inputs in the JavaScript and the form's ACTION is set
to Y. But the problem is, that somehow the content area of X and Y are
surrounded with a FORM generated by ASP.NET. I think ASP.NET replaces
the content area with a FORM.
I created a form in the page x, but I think the form is somehow merged
with the form that is generated by ASP.NET. The form also adds a
_VIEWSTATE input, so when the form is posted this field is also
posted.
<form ...> <-ASP.NET generated one
<input type="hidden" name="_VIEWSTATE"...>
<form action="Y.aspx"...> <-I wrote
...
<input type="submit"/>
</form>
</form>
When the submit button is clicked it's not posted to Y.aspx, but the
form genereated by ASP.NET gets posted. I could replace the ACTION of
the ASP.NET generated form with JavaScript but the _VIEWSTATE causes
an exception when posted to another page.
I've searched MSDN and found a solution about posting to another page.
That page explained how to do it with controls like Button, Link and
so on. But in reality, we usually check form with JavaScript before
post. Posting the form with just a Button click is impractical.
How can I solve this situation? More specifically, I'd like to 1)
remove the auto-generated form for content area or 2)post only the
form I created not the outer form or 3) remove the _VIEWSTATE field.