Hour 9. Web Form Basics


In this hour, we will cover

  • How user input is gathered through HTML

  • What a Web Form is

  • Using a Web Form in an ASP.NET web page

  • Identifying properties of Web Forms

  • Collecting user input in an ASP.NET web page

  • Examining how the Web Form persists the state of its Web controls

To create a useful web application, we must be able to somehow collect user input and return to the user a web page customized to the input entered. For example, search engines like Google must be able to accept a user's search term and then display a web page with the results based on that search. Sites like Amazon.com must be able to read a shopper's credit card numbers so that they can correctly bill the shopper for purchases.

HTML was designed with these needs in mind, as evidenced by the various HTML elements designed to aid in collecting user input. The HTML <input> element, for example, can be used to display a text box, check box, radio button, or drop-down list. After the user enters information, the HTML <form> element specifies which web page the input should be sent to.

With ASP.NET we do not need to enter such HTML elements. Rather, we use various Web controls, which, when rendered, produce the appropriate HTML elements. That is, if we want to have a text box on our web page, instead of adding an <input> HTML element, we add a TextBox Web control. Similarly, instead of using the HTML <form> element, our ASP.NET web pages need to use Web Forms. We'll discuss what Web Forms are and their semantics in this hour.

If you have worked with HTML forms and collecting user input in dynamic web page technologies like ASP, PHP, or JSP, you'll find ASP.NET's model for collecting user input quite a bit different. By the end of this hour, though, you will likely find ASP.NET's way of collecting user input through Web Forms to be much more intuitive and sensible than the techniques required for user input collection in older, dynamic web page technologies.




Sams Teach Yourself ASP. NET 2.0 in 24 Hours, Complete Starter Kit
Sams Teach Yourself ASP.NET 2.0 in 24 Hours, Complete Starter Kit
ISBN: 0672327384
EAN: 2147483647
Year: 2004
Pages: 233

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net