Basic Date Picker Documentation

BasicDatePicker.MaximumDate Property

Gets or sets the date that specifies the maximum allowable selectable date.

[Visual Basic]
Public Property MaximumDate As Date
[C#]
public System.DateTime MaximumDate {get; set;}

Property Value

A DateTime value representing the maximum allowable selectable date. Default value is DateTime.MaxValue.

Example

[Visual Basic, C#] The following example demonstrates how to use the MaximumDate property to programmatically set the maximum allowable selectable date. All dates after the MaximumDate will be disabled.

 [Visual Basic]
<%@ Page Language="VB" AutoEventWireup="true" %>
<%@ Register TagPrefix="bdp" Namespace="BasicFrame.WebControls" Assembly="BasicFrame.WebControls.BasicDatePicker" %>
<html>
    <head>
        <title>Basic Date Picker MaximumDate Example</title>
        <script runat="server">
            Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
                If Not IsPostBack Then
                    ' Set SelectedDate to Today
                    ' Set MaximumDate to Today
                    this.BasicDatePicker1.SelectedDate = DateTime.Today
                    this.BasicDatePicker1.MaximumDate = DateTime.Today
                End If
            End Sub
        </script>
    </head>
    <body>
        <form runat="server">
            <h3>Basic Date Picker MaximumDate Example</h3>
            <bdp:BasicDatePicker ID="BasicDatePicker1" runat="server"></bdp:BasicDatePicker>
        </form>
    </body>
</html>
 
 [C#]
<%@ Register TagPrefix="bdp" Namespace="BasicFrame.WebControls" Assembly="BasicFrame.WebControls.BasicDatePicker" %>
<%@ Page Language="C#" AutoEventWireup="true" debug="true"%>
<html>
    <head>
        <title>Basic Date Picker MaximumDate Example</title>
        <script runat="server">
            void Page_Load(Object sender, EventArgs e)
            {
                // Set SelectedDate to Today
                // Set MaximumDate to Today
                if (!IsPostBack)
                {
                    this.BasicDatePicker1.SelectedDate = DateTime.Today;
                    this.BasicDatePicker1.MaximumDate = DateTime.Today;
                }
            }
        </script>
    </head>
    <body>
        <form runat="server">
            <h3>Basic Date Picker MaximumDate Example</h3>
            <bdp:BasicDatePicker ID="BasicDatePicker1" runat="server"></bdp:BasicDatePicker>
        </form>
    </body>
</html>
 

See Also

BasicDatePicker Class | BasicFrame.WebControls Namespace | MinimumDate | IsDate | ReadOnly