HTML and CSS Reference
In-Depth Information
chapter 5
n n n
Working with Forms
and Controls
One of the key areas where ASP.NET shines is developing data-driven web applications. Most ASP.NET web
applications are more than collections of HTML pages. They involve a variety of database tasks ranging
from simple listings of records to complex database operations. These tasks often include accepting user
input, performing validation on the data entered by the user, processing the data on the server, and finally
saving it in a data store.
A data-entry page typically presents a set of controls such as text boxes, check boxes, radio buttons,
drop-down lists, and similar elements. These controls are housed in an HTML <form> element. Upon filling
the form, the user can submit the form along with its data to the server for processing. Over the years,
developing an HTML form has become more complex and demanding. For example, many forms call for
complex data-format and business validations. They also need different types of controls for specific data
types such date-time and numbers. Keeping these changing requirements and trends in mind, HTML5
offers a set of enhancements to the existing <form> features. It has also introduced new features that make
overall form development easier. This chapter gives you a detailed introduction to these new and
enhanced form features of HTML5. Specifically, you learn about the following:
• Using new HTML5 input types
• Improvements to the existing controls
• Using the newly added and enhanced features of HTML5 in ASP.NET Web Forms
and MVC applications
• Validating user input using various techniques
Understanding HTML Forms in ASP.NET
Whenever you develop a data-driven ASP.NET or ASP.NET MVC application, the application's user
interface is rendered with the help of Web Forms and views, respectively. Web Forms and views in turn use
the HTML <form> element to house the data-entry region of the page. Before this chapter delves into the
HTML5-specific features of the <form> element, it's worthwhile to briefly discuss how a <form> element
appears in a typical ASP.NET Web Forms and ASP.NET MVC application.
Search WWH ::

Custom Search