DatePicker Specification


DatePicker Specification

Most complex server controls are implemented as composite controls that reuse the functionality of other existing server controls. DatePicker is implemented as a composite control that contains other standard ASP.NET server controls as part of its Controls collection ”a TextBox , an Image , and a RegularExpressionValidator . Besides reusing their rendering functionality, the DatePicker control uses the TextBox control to implement its text-entry UI and its postback capabilities and uses the validator control to validate the format of the date and ensure valid entries.

When the Web browser client supports DHTML and JavaScript, DatePicker uses those capabilities to offer an interactive date-selection UI, which includes a drop-down calendar and month navigation. The DatePicker control packages its client functionality into a set of script files, which are included in the page during the rendering process. When the page is rendered to a Web browser that does not support DHTML, the DatePicker control provides an alternative UI ”a plain text box ”but preserves its core functionality to allow the user to enter a date.

Like all server controls, the DatePicker control has an object model that allows page developers to program against it from server-side code. The DatePicker control's object model mimics that of the standard ASP.NET TextBox control and includes properties such as AutoPostBack and Columns . However, rather than providing a Text property of type String and a TextChanged event as the standard TextBox control does, the DatePicker control offers a SelectedDate property of type DateTime as well as a DateChanged event. In addition, DatePicker allows the page developer to customize the appearance of the pop-up calendar by using style properties that are similar to the standard ASP.NET Calendar control.

As with all well-designed server controls, the DatePicker control includes an associated designer that enhances its appearance on a visual design surface to provide a WYSIWYG view of the control.



Developing Microsoft ASP. NET Server Controls and Components
Developing Microsoft ASP.NET Server Controls and Components (Pro-Developer)
ISBN: 0735615829
EAN: 2147483647
Year: 2005
Pages: 183

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