Basic Date Picker Documentation

BasicDatePicker.IsNull Property

Gets a value indicating whether the SelectedDate is [Null]. There is no DateTime Null value in .NET, so DateTime.MinValue is returned to represent [Null].

[Visual Basic]
Overrides Public ReadOnly Property IsNull As Boolean
[C#]
public override bool IsNull {get;}

Property Value

Is the SelectedDate DateTime.MinValue (Null).

Remarks

The DateTime object is a value type and can not be null. BasicDatePicker uses DateTime.MinValue to represent a Null DateTime.

Example

The IsNull property allows for easy checking of empty dates.

 if (!BasicDatePicker1.IsNull && this.BasicDatePicker1.IsDate)
        Response.Write("Valid");
    else
        Response.Write("Invalid");

If you are using a DataReader, using the IsDBNull method simplifies setting the SelectedDate.

 this.BasicDatePicker1.SelectedDate = myReader.IsDBNull(0) ? DateTime.MinValue : myReader.GetDateTime(0)
 //<--- 0 is the column in the DataReader.

See Also

BasicDatePicker Class | BasicFrame.WebControls Namespace | IsDate | DateTime.MinValue