The Calendar Control

If you want to allow a user to select a date, displaying a calendar is the right way to do it. You could fashion your own calendar using an HTML table and a lot of scripting code (many developers have done this, in many different ways), but it's a lot of effort. Fortunately, ASP.NET handles this effort for you. The Calendar control, shown in Figure 22.2 (see the sample page CalendarControl.aspx) displays a neatly formatted, bindable table-like view that provides for almost any “look” you need. (Actually, if you view the source for the page containing the Calendar control in the browser, you'll see that it actually is an HTML table, albeit a somewhat complex one.)

Figure 22.2. Use the Calendar control to select a date.

The ...

Get ASP.NET Developer's JumpStart now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.