This Month Tech Spotlight - July 2008

Creating a Reusable Date Control


Creating date data entry controls for a .NET web application can be cumbersome because Visual Studio does not come with a standard date picker control (though it comes with a Calendar control). The lack of such a control means that we usually have to create at least two controls to accept dates from users, a TextBox control to hold the date and a CompareValidator to make sure that entered information is a valid date. Obviously, we could make do with a simple TextBox control and hope that users never enter an invalid date value but we all know how this is going to work out.

Ideally, users should not have to enter any date information manually (although they should be able if they so choose); the easier solution is to let users to select a date value from a calendar. This, however, means that we have to add a number of additional controls and some code, be it JavaScript or server-side code, to show and hide the calendar because it is usually impractical, at least from a form layout standpoint, to have the Calendar control visible at all times.

In order to avoid having to recreate the same controls and code every time we need a control to enter date information we decided to create a user control that can be reused not only within the same project but also across projects. Obviously, we should create a custom control that can be compiled to make the control truly reusable but for now a user control serves our purpose.


continue reading...

About Action Systems

At Action Systems we are committed to developing quality desktop and web-based database applications and solutions that are tailored to your specific needs.

We work with you to integrate, transfer, process, consolidate, and disseminate your company's mission critial data in order to increase the productivity of your organization.


Why Action Systems?

  • Extensive database programming experience (Oracle, SQL Server, and MS Access)
  • Successful integration of server-side technology with client-side programming for easy to use and responsive web applications
  • Personalized and attentive service and support from the preliminary analysis to the final solution