Be the first to write a review
Using the ASP.NET Calendar Control
When building web applications, at some point during your requirements documentation you’ll probably come across the need for users to enter dates onto a form. Working with dates may seem like a simple task but it can quite easily become very complicated.
The reason date entry becomes complex is because of the validation that needs to be performed. In older languages this validation was provided by the developer. They had to consider all kinds of conditional checks, such as the number of days in the selected month, whether the selected February was in a leap year, as well as all the rules regarding leap years.
Fortunately, ASP.NET has made this style of date programming a thing of the past. The .NET framework has a built-in calendar component which provides all the basic functionality for most development scenarios and it comes pre-programmed with all of the aforementioned validation already in place.
By using this component the developer can focus on other aspects such as presentation and usability functionality instead of worrying about whether February 2028 has 28 or 29 days.
In this tutorial we’ll look at some of the basic functionality provided by the ASP.NET Calendar component and two basic examples of common usage of this component in web applications. We’ll also look at some of the basic formatting methods provided by the Date class.
Note: This tutorial requires Visual Studio .NET and both VB.NET and C# code samples will be provided
Kevin Koch
Kevin Koch is a senior software engineer with over 8 years experience designing and architecting primarily web based applications. Fresh out of college during the nineties he co-founded Task Solutions and developed several projects with the then popular classic ASP.
During the Dot Com boom Kevin left his position as president and joined a new venture to build an enterprise insurance claim system build upon J2EE technology. After the Dot Com crash Kevin schooled himself to become an expert with .NET technology and is currently freelancing his ASP.NET skills to build enterprise n-tier frameworks using advanced OO methodologies.