I read somewhere that the web form model requires that each form be posted to the same form. So what's the point of the action attribute of the form tag?
Taken from Microsoft's web site.
"The action property of the HtmlForm tag is always the current page. Although this change was intended to prevent cross-page changes to the URL in a Web Form, this also prevents the change in the QueryString of a Web Form. You cannot change or remove the QueryString of a Web Form."
Here is the link to that article, that shows a work around as well:
To me it's much simplier to submit the form to the same page and use IsPostBack property of Page class to separate a first run from the post back, rather than create a separate page to process form values. Matter of preference though.
In ASP.NET, the value for a server-side <FORM>'s ACTION property is set to the current WebForm by default. You therefore don't need to set it if posting back to the same form.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.