ASP.NET Date Picker Calendar Web Control

Basic Date Picker is a professional cross-browser ASP.NET calendar web control. This quick loading JavaScript calendar enables rapid, error free, date selection without the use of pop-up windows. Save development time and optimize user experience with this highly flexible, customizable ASP.NET datepicker web control.

Supports Visual Studio .NET 2008

Supports Visual Studio .NET 2005

Supports Visual Studio .NET 2003

free calendar date picker web control

Quick Demo
Select a date from the calendar.
Try out a few of the customizable properties...

Custom Date Formats

Culture

Display Type

Rows/Columns
/



"Thank you for all your help and quick response. Love the product."

Ben from Commerce Bank

"I got more than my moneys worth in product and customer service!"

Phillip from L.A.

"thanks very much. That's superb service, I'am amazed...!!"

Chris from Australia
» Read what others are saying  

RECENT NEWS

TIP: How to determine Assembly Version Number

There are several ways to determine the Assembly Version Number, although probably the easiest is opening the controls smart-tag in Visual Studio 2005 design view. The version number is listed in the bottom-right corner. See:

Another way to view the version number is by opening a page in a browser and viewing the HTML source code. The version number is listed just inside the wrapping <span> of the control. Example:

<span id="BasicDatePicker1" class="basicdatepicker"><!-- Version 1.3.5.0.

A third way is to open File Explorer and browse to your projects /Bin/ directory. Select the BasicFrame.WebControls.BasicDatePicker.dll file, then right-click and view "Properties". Under the File version should be listed under the "Version" tab.

Hope this helps.

Posted Tuesday February 27, 2007

NEWS: Microsoft AJAX Beta 2.0 Compatibility

We've just released a new build which provides full support for the recently released Microsoft AJAX Beta 2.0 release.

Download the latest .NET 2.0 installer from http://www.basicdatepicker.com/download/

Please feel free to contact us if you have any questions or comments and we will do our best to help out.

Posted Friday November 10, 2006

NEWS: Microsoft AJAX Beta 1.0 support (and Atlas too)

We're happy to inform everyone — that to the best of our knowledge — we're the first third party ASP.NET control suite to support the recently released Microsoft AJAX Beta 1.0 release. We've supported the Atlas CTP build for a while, and now we support both.

No need for separate installers and your upgrade path from Atlas to AJAX should be seamless.

Download the latest .NET 2.0 installer from http://www.basicdatepicker.com/download/

Please feel free to contact us if you have any questions or comments and we will do our best to help out.

Posted Friday October 27, 2006

SAMPLE: Set the MinimumDate client-side.

The following sample demonstrates a typical Date Range Selection scenario similar to selecting travel dates.

Two date pickers are linked together so when the StartDate is changed, the EndDate is updated to be 7 days after the selected StartDate. See Sample

The EndDate is updated when the client-side JavaScript function OnClientAfterSelectionChanged is fired.

A DateRangeValidator and DateDifferenceValidator are also used within the sample. The DateRangeValidator checks to ensure the StartDate does not occur in the past and the DateDifferenceValidator checks to ensure the EndDate is at least 7 days greater than the StartDate.

Posted Wednesday September 20, 2006

FEATURE: ATLAS Support

We've added full support for the Microsoft "Atlas" Framework.

Now you can just drag and drop a Date Picker (or Time Picker) into your atlas UpdatePanel and everything just works.

The following Sample demonstrates how to use the DatePicker and TimePicker within an Atlas UpdatePanel while data binding to GridView and FormView controls. See Sample.

Atlas support has also been extended to the free date picker (BDPLite).

Posted Friday September 1, 2006

FEATURE: NullDate Property

We added a new NullDate property to BasicDatePicker which allows the developer to override what DateTime value is used to represent a 'null' or empty date.

In previous versions DateTime.MinValue was used, and it's still the default value, but it can now be overridden with any DateTime value.

For example, some applications may use DateTime.MaxValue to represent a null or empty value.

[VB]
Me.BasicDatePicker1.NullDate = DateTime.MaxValue

[C#]
this.BasicDatePicker1.NullDate = DateTime.MaxValue;


See also
    SelectedValue property

Note: The NullDate property is not available in BDPLite.

Posted Thursday July 27, 2006

FEATURE: SelectedValue property

We added a new SelectedValue property to both BasicDatePicker and BDPLite.

The SelectedValue property should help solve problems with auto binding to a DataSource that may contain null or DBNull date values.

The following sample demonstrates using a GridView and SQLDataSource control to bind to the new SelectedValue property. See Sample

To get access to the SelectedValue property you must download and install the latest build.

Please feel free to contact us if you have any questions or comments and we will do our best to help out.

Hope this helps.

Posted Thursday July 27, 2006

SAMPLE: Disable all Sundays and Validate

We added another interesting sample which demonstrates how to disable all Sundays within the popup Calendar by using the OnClientDayRender client-side event and use the Microsoft CustomValidator Control to ensure a user did not type in a date that was a Sunday. See Sample.

The SelectableWeekendDays property can be used if you want to disable both weekend days (Saturday & Sunday). Example:

<BDP:BasicDatePicker ID="BasicDatePicker1" runat="server" SelectableWeekendDays="false" />


Hope this helps.

Posted Thursday July 13, 2006

SAMPLE: Using DateCompareValidator to validate Age

Tip: Using DateCompareValidator to validate Age

A customer sent us a question on how to validate that an Age was greater than 18 years. We came up with the following simple example to demonstrate the technique.

Step 1: Add a BasicDatePicker and DateCompareValidator to your page and Set the ControlToValidate property. Example:

[HTML/Design View]
<BDP:BasicDatePicker ID="BasicDatePicker1" runat="server" /> <BDP:DateCompareValidator
    ID="AgeCompareValidator"
    runat="server"
    ControlToValidate="BasicDatePicker1"
    ErrorMessage="Must 18 years or older."
    Operator="LessThanEqual">
</BDP:DateCompareValidator>

The key to making this all work is setting the DateToCompare property of the DateCompareValidator to a Date 18 years in the past.

Step 2: Add the following to your code behind (Page_load). Example:

[Visual Basic]
Me.AgeCompareValidator.DateToCompare = DateTime.Today.AddYears(-18)

[C#]
this.AgeCompareValidator.DateToCompare = DateTime.Today.AddYears(-18);


To test the above sample, open the WebForm in a browser and type the following:

1. Within the Date Picker TextBox, type "t-18y" (without quotes), then tab off. The Selected Date will be set to "Today minus 18 years", which will pass the DateCompareValidator.
2. Click inside the TextBox and hit the up-arrow on your keyboard which will add one day to the above date. This new date will fail validation.


Related to the above Age Validation, if you want to Calculate an Age based on a supplied Date, the following Age() Method can be used from your code-behind. Example:

[C#]
/// <summary>
/// Calculates the Age based on a given birth date.
/// </summary>
/// <param name="birthDate">Birth date to calculate age.</param>
/// <returns>Returns the age as an Integer.</returns>
public int Age(DateTime dateOfBirth)
{
    if (DateTime.Today.Month < dateOfBirth.Month || DateTime.Today.Month == dateOfBirth.Month && DateTime.Today.Day < dateOfBirth.Day)
    {
        return DateTime.Today.Year - dateOfBirth.Year - 1;
    }
    else
    {
        return DateTime.Today.Year - dateOfBirth.Year;
    }
}


Hope this helps.

Posted Thursday July 13, 2006

SAMPLE: Using DateDifferenceValidator

We've had several questions lately requesting more information about the DateDifferenceValidator, so we put together a simple DateDifferenceValidator sample page with description and code sample. See Sample

The above DateDifferenceValidator sample will be added to the documentation and available on the next build.

Posted Thursday June 29, 2006

Tip: Manually install Component Icons to Visual Studio ToolBox

If for some reason the date picker component icons do not get installed to your Visual Studio or Visual Web Developer Express Toolbox when you run the .msi installer, they're easy to install manually. Steps:

  1. Open Visual Studio or Visual Web Developer
  2. Open an .aspx page
  3. Open the ToolBox panel. Typically located on the left side in a fly-out panel (Ctrl + Alt + x).
  4. If a "Basic Date Picker" Tab has already been created, click to slide open. If the "Basic Date Picker" Tab was not created during the installation process, you can create now.
    1. Right-Click in the ToolBox area.
    2. Select "Add Tab".
    3. Enter "Basic Date Picker".
  5. Inside the "Basic Date Picker" tab, Right-Click and select "Choose Item..." ("Add/Remove Items..." in Visual Studio .NET 2003).
  6. Under the ".NET Framework Components" Tab select the "Browse" button.
  7. Navigate to and select the following .dll file on your file system, choose open.
  8.       C:\Program Files\Common Files\Basic Date Picker\DateTime Suite\1_3_3\BasicFrame.WebControls.BasicDatePicker.dll

    NOTE: The "1_3_3" above is the version number and may vary.

  9. The component items should be added to the list and pre-checked. You can confirm by sorting the list by "Namespace" and scrolling to "BasicFrame.WebControls"
  10. Click "OK". The icons should be added to your ToolBox. You should now be able to drag/drop a date picker onto your WebForm.

    NOTE: You can also drag and drop the icons between tabs to reorder if desired.
Hope this helps.

Posted Wednesday June 28, 2006

Tip: How to change the size of the TextBox?

We added another Q&A to our list of Top Support Questions which details several techniques for changing the size of the TextBox. See http://www.basicdatepicker.com/support/#q5

Our favorite is probably Option #3. A straightforward CSS edit that we add to our global .css file and the style is picked up application wide by all date pickers. eazy peazy. No source code (.aspx/code-behind) edits is also a bonus.


Posted Tuesday June 27, 2006

Resource: Listing all .NET supported Cultures

We created a sample page demonstrating how to output a list all the .NET supported Cultures. The list details several properties of the CultureInfo object including the Date and Time Formats as well as sample output for each.

EnglishName
Abbreviation
ShortDate Format + example
LongDate Format + example
ShortTime Format + example
LongTime Format + example

The sample also demonstrates how to sort a list of Cultures by creating a custom IComparer Class and comparing the EnglishName strings.

The C# code used in this example is available at the bottom of the table.

See Sample

See also
    Standard DateTime Format Strings | Custom DateTime Format Strings

Posted Thursday June 22, 2006