asp.net.ph

Skip Navigation LinksHome > ASP.NET Web Forms > Web Forms Server Controls > Controls You Can Use on Web Forms > ASP.NET HTML WebControls

ASP.NET HTML Controls

  Section Index


HtmlForm Server Control

Provides programmatic access to the HTML <form> element on the server.

The HtmlForm control <form runat=server> creates an ASP.NET implementation of the HTML Form element.

Forms enable users to submit data to a server in a standardized format. Forms can collect data in different ways, using a variety of control elements.

Users typically fill in the required data by typing directly into input boxes, by checking options in a checkbox or radio button group, or by selecting options from a dropdown listbox. A submit button is ususally provided to collect and send the form’s data set to the server.

An HtmlForm control is required to process postback requests. All server control markup must be declared within the <form runat=server>...</form> tags.

To be submitted with the form’s data set, each of the form controls must be assigned a name and have a valid value. Only controls with a valid name/value pair are sent to the receiving program for processing.

In addition to form controls, a form can contain other elements used for layout and rendering, such as tables, paragraphs, or lists.

The following sample illustrates using an HtmlForm control that contains a set of HtmlButton controls. The form handler demonstrates a simple way to determine which of the form’s controls have been selected, using the individual control’s ID.

Using the HtmlForm Control for Postback Requests
Run Sample | View Source

NOTE: A Web Forms page can have only one server side <form> control.

See Also

HtmlForm Control Syntax   HTML FORM Element

More ...
Back to top


© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note