Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Form Posting

Status
Not open for further replies.

Ladyhawk

Programmer
Jan 22, 2002
534
AU
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?

Ladyhawk. [idea]
** ASP/VB/Java Programmer **
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top