Support

We back our control. Everyone receives unlimited email and online support in the forums. Full list of Contact options available here.

ForumsContact UsDcoumentation

Top Technical Support Questions

Q: How do I get/set the Date in the TextBox?

Think of the date picker as a Calendar and not as a TextBox. The control accepts and returns a DateTime object.

To Get the date...

Example

[Visual Basic]
Dim myDate As Date = this.BasicDatePicker1.SelectedDate


[C#]
DateTime myDate = this.BasicDatePicker1.SelectedDate;

To Set the date of the calendar...

Example

[Visual Basic]
BasicDatePicker1.SelectedDate = Date.Today


[C#]								
BasicDatePicker1.SelectedDate = DateTime.Today;

See Also

SelectedDate

Q: How do I change the size of the TextBox?

There are several ways to change the size of the TextBox with BasicDatePicker and BDPLite. Each example below contains a Design-mode and/or StyleSheet code sample.

Option #1: .TextBoxColumns Property (BasicDatePicker & BDPLite)

This is the easiest and fastest option to implement, although not a CSS technique (others detailed below). The .TextBoxColumns property maps directly 'size' attribute of the input tag. Example:

[Design Mode]
<BDP:BasicDatePicker id="BasicDatePicker1"
     runat="server" TextBoxColumns="15" />


<BDP:BDPLite id="BDPLite1"
     runat="server" TextBoxColumns="15" />
[Visual Basic]
BasicDatePicker1.TextBoxColumns = 15

[C#]
BasicDatePicker1.TextBoxColumns = 15;

Option #2: .TextBoxStyle.Width Property (BasicDatePicker)

All the standard Style attributes are available through the TextBoxStyle property. Each element of BasicDatePicker will have a corresponding Style property. Example:

[Design Mode]
<BDP:BasicDatePicker id="BasicDatePicker1" runat="server" >
    <TextBoxStyle width="80px" />
</BDP:BasicDatePicker>

[Visual Basic]
BasicDatePicker1.TextBoxStyle.Width = Unit.Pixel(80)

[C#]
BasicDatePicker1.TextBoxStyle.Width = Unit.Pixel(80);

Option #3: StyleSheet general (BasicDatePicker & BDPLite)

The basicdatepicker.css can be used to control much of the look and feel of the control. By adding a <input> tag specific class to the .css file, you can override the width of the TextBox application wide. Example:

[StyleSheet]
.basicdatepicker input {
    width: 80px;
    }

.bdplite input {
    width: 80px;
    }

Option #4: StyleSheet specific (BasicDatePicker)

By assigning a specific StyleSheet class to the TextBox, you can modifiy the date picker on a control-by-control basis through stylesheets. Example:

[Design Mode]
<BDP:BasicDatePicker id="BasicDatePicker1" runat="server">
      <TextBoxStyle cssclass="NarrowDatePicker" />
</BDP:BasicDatePicker>

[Visual Basic]
BasicDatePicker1.TextBoxStyle.CssClass = "NarrowDatePicker"

[C#]
BasicDatePicker1.TextBoxStyle.CssClass = "NarrowDatePicker";

[StyleSheet]
.NarrowDatePicker {
      width: 80px;
      }

See Also

TextBoxColumns

Q: The date picker works great locally, but when I upload to my web server, I get the following JavaScript error - "Unable to find script library..."

As of version 1.2.2411 (.NET 2.0 only), all resource files (.js, .css, images) are Embedded within the Assembly and this workaround may not be required.

To download the latest installer, please visit http://www.basicdatepicker.com/download/.

Short answer: Upload your local aspnet_client directory to the web application root on your remote web server. The web application root is sometimes referred to as the 'ftp root'. This is the same location that you typically store the Web.config and Global.asax files.

Microsoft recommends all web controls which reference external files, should reference that file from the aspnet_client directory. When the installer was run, a folder (/basicframe_webcontrols_basicdatepicker/) was created in your local wwwroot/aspnet_client/ directory, this contains all the files (.js, .css and images) required by the date picker.

By default the date picker will look for the files in the aspnet_client directory. With each control you can also point the ResourcePath property to another location. For example, if you wish to store all the required files in a /datepicker/ folder off your web application root, the bdp tag would look like the following. Example:

<bdp:BasicDatePicker
    id="Basicdatepicker1"
    runat="server"
    ResourcePath="~/datepicker/" />

Typically you can find the aspnet_client directory locally with the following path:

C:\Inetpub\wwwroot\aspnet_client\

Q: When I view the date picker on my web server an "Unlicensed" message appears. I thought the control was free? How do I remove the message?

There are two date pickers shipped with the Assembly. One is free (BDPLite) and the other (BasicDatePicker) will display an "Unlicensed" message if no LicenseKey is set.

The differences between BDPLite and BasicDatePicker are outlined in the BDPLite Comparison.

BasicDatePicker will work without restriction if on either http://localhost/ or http://127.0.0.1/.

If the "Unlicensed" message is displayed and you wish to use the free date picker (BDPLite) you must change the webcontrol tag as follows:

<!-- Change the following <bdp:BasicDatePicker> to <bdp:BDPLite> -->
<bdp:BasicDatePicker 
    id="Basicdatepicker1"
    runat="server" 
    />

<!-- <bdp:BDPLite> is the free date picker -->
<bdp:BDPLite 
    id="BDPLite1"
    runat="server" 
    />

To remove the "Unlicensed" message from BasicDatePicker, you must purchase a LicenseKey.

If you purchase a LicenseKey, the key will be attached as a .txt file to the Welcome Kit email which is automatically emailed upon completion of the transaction at PayPal.

Once you have a valid LicenseKey, there are two ways the key can be Set.

Option #1 Web.Config - Sets LicenseKey application wide.

Example

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="BasicDatePickerLicenseKey"
	  value="*** ADD KEY HERE ***" />
  </appSettings>    
  <system.web>...

Option #2 Application_Start Event - Sets LicenseKey application wide by adding to your Global.asax file.

Example

[C#]
void Application_Start(object sender, EventArgs e)
{
    Application["BasicDatePicker.LicenseKey"] = "*** ADD KEY HERE ***"";
}

See Also

LicenseKey

Q: I need to display a different date format. For example "M/d/yyyy". How do I do that?

You can change the date format of the date picker by setting the DateFormat property.

Example

Date format Curent culture Description
d-MMM-yyyy en-US Date format = "d-MMM-yyy";
Output = 1-Feb-2005.
d en-US Uses Culture.DateTimeFormat.ShortDatePattern.
Date format = "M/d/yyyy"; Output = 2/1/2005.
D en-US Uses Culture.DateTimeFormat.LongDatePattern.
Date format = "MMMM d, yyyy"; Output = February 1, 2005.

 

[Visual Basic]
Imports BasicFrame.WebControls 'import namespace

BasicDatePicker1.SelectedDate = Date.Today
BasicDatePicker1.DateFormat = "d"
Response.Write(BasicDatePicker1.SelectedDateFormatted)

'This code produces the following output for 1-Dec-2006.
'
'12/1/2006


[C#]
using BasicFrame.WebControls; //import namespace

BasicDatePicker1.SelectedDate = DateTime.Today;
BasicDatePicker1.DateFormat = "d";
Response.Write(BasicDatePicker1.SelectedDateFormatted);

/* 
This code produces the following output for 1-Dec-2006.

12/1/2006
*/

You can also use the Standard Microsoft .NET DateTime Format Specifiers to build a custom date format.

Basic Date Picker follows the .NET Standard Date Format Strings. The characters ' d M y ' are reserved.

Format specifiers Current culture Output Current culture Output
d en-US 1 fr-FR 1
dd en-US 01 fr-FR 01
ddd en-US Tue fr-FR mar.
dddd en-US Tuesday fr-FR mardi
M en-US 2 fr-FR 2
MM en-US 02 fr-FR 02
MMM en-US Feb fr-FR févr.
MMMM en-US February fr-FR février
yy en-US 05 fr-FR 05
yyyy en-US 2005 fr-FR 2005

Example

[Visual Basic]
BasicDatePicker1.SelectedDate = Date.Today
BasicDatePicker1.DateFormat = "MMMM d, yyyy"
Response.Write(BasicDatePicker1.SelectedDateFormatted)
'This code produces the following output for 1-Dec-2006.
'
'December 1, 2006


[C#]
BasicDatePicker1.SelectedDate = DateTime.Today;
BasicDatePicker1.DateFormat = "MMMM d, yyyy";
Response.Write(BasicDatePicker1.SelectedDateFormatted);
/* 
This code produces the following output for 1-Dec-2006.

December 1, 2006             
*/

 

The following sample lists all .NET supported Cultures and several date and time formats. See /samples/cultureinfo.aspx

See Also

DateFormat | CustomDateFormat | SelectedDate | SelectedDateFormatted