Microsoft ASP.NET Web Matrix Starter Kit (Bpg-Other)
|
Overview
Guestbooks are common features of personal Web sites; they provide a place where visitors can enter their thoughts about your site or about the world at large. A guestbook also happens to be a good way to illustrate the basics of using Microsoft ASP.NET Web pages for data entry. In this chapter, I ll show you how to use the tools in Web Matrix to create code for entering new records into a database. I ll show you a couple of tricks for customizing the MxDataGrid control introduced in Chapter 9. I ll explain how you can use the validator controls in Web Matrix to quickly and easily check user input on your pages. I ll also discuss some security issues you need to know about when creating a data-entry page and show you how to protect your application from people who might try to enter malicious data into your pages.
Figure 10-1 shows a guestbook page similar to the one we ll be working on in this chapter.
Naturally, visitors will want to see the comments in the guestbook. Allowing visitors to view the comments affords an opportunity to play around a bit with how to display data. In this chapter, you ll create a quick- and-dirty page to display guestbook entries. (In Chapter 11, I ll show you more flexible ways to display the guestbook.) The quick-and-dirty display of the guestbook that we ll create will look like Figure 10-2.
|