Gets or sets the current selected date of the calendar. Accepts and returns a DateTime object.
A DateTime object that represents the selected date. The default value is DateTime.MinValue (Null).
Use the SelectedDate property to determine the selected date of the BDPLite control.
The SelectedDate property is set using a DateTime object.
A post back event is NOT raised when the user navigates between months.
Note The BDPLite control does not have a AutoPostBack property and can not handle OnSelectionChanged events. Please see BasicDatePicker for these features.
[Visual Basic, C#] The following example demonstrates how to use the SelectedDate property to get the selected date from the BDPLite.
[Visual Basic]
<%@ Page Language="VB" AutoEventWireup="True" %>
<%@ Register TagPrefix="bdp" Namespace="BasicFrame.WebControls" Assembly="BasicFrame.WebControls.BasicDatePicker" %>
<html>
<head>
<title>BDP Lite SelectedDate 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
BDPLite1.SelectedDate = DateTime.Today
End If
End Sub
Sub Button_Click(sender As Object, e As EventArgs)
Dim tempDate As DateTime = Me.BDPLite.SelectedDate
tempDate = TempDate.AddDays(7)
Response.Write("One week from Today is " + tempDate.ToString("d-MMM-yyyy"))
End Sub
</script>
</head>
<body>
<form id="Form1" runat="server">
<h3>BDP Lite SelectedDate Example</h3>
<BDP:bdplite id="BDPLite1" runat="server"></BDP:bdplite>
<p><asp:button
id="Button1"
runat="server"
text="Submit"
onclick="Button_Click"></asp:button></p>
</form>
</body>
</html>
[C#]
<%@ Page Language="C#" AutoEventWireup="True" %>
<%@ Register TagPrefix="bdp" Namespace="BasicFrame.WebControls" Assembly="BasicFrame.WebControls.BasicDatePicker" %>
<html>
<head>
<title>BDP Lite SelectedDate Example</title>
<script runat="server">
void Page_Load(Object sender, System.EventArgs e)
{
// Set SelectedDate to Today
if(!IsPostBack)
this.BDPLite1.SelectedDate = DateTime.Today;
}
private void Button_Click(object sender, System.EventArgs e)
{
DateTime tempDate = this.BDPLite1.SelectedDate;
tempDate = tempDate.AddDays(7);
Response.Write("One week from Today is " + tempDate.ToString("d-MMM-yyyy"));
}
</script>
</head>
<body>
<form id="Form1" runat="server">
<h3>BDP Lite SelectedDate Example</h3>
<BDP:bdplite id="BDPLite1" runat="server"></BDP:bdplite>
<p><asp:button
id="Button1"
runat="server"
text="Submit"
onclick="Button_Click"></asp:button></p>
</form>
</body>
</html>
BDPLite Class | BasicFrame.WebControls Namespace | SelectedDateFormatted