Basic Date Picker Documentation

BasicDatePicker.TimePicker Property

Gets or sets the Id of the TimePicker which is linked to this instance of the Date Picker.

[Visual Basic]
Public Property TimePicker As String
[C#]
public string TimePicker {get; set;}

Property Value

Returns the Id of the TimePicker that is linked to this instance of the Date Picker.

Remarks

If a TimePicker is linked to the DatePicker, the TimePickers SelectedTime property will be automatically added to the DatePickers SelectedDate property.

If no TimePicker is linked, the Time portion of the DateTime value returned by the SelectedDate property will default to 12:00 AM (start of day).

One TimePicker can be attached to zero-to-many instances of a Date Picker.

Example

The following example demonstrates how to link a TimePicker to an instance of a Date Picker and Response.Write the SelectedDate property. The SelectedDate property will add together the SelectedDate and SelectedTime properties automatically.

[Visual Basic]
<%@ Page language="VB" @>
<%@ Register TagPrefix="bdp" Namespace="BasicFrame.WebControls" Assembly="BasicFrame.WebControls.BasicDatePicker" @%>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
     "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html>
  <head>
    <title>TimePicker</title>
    <script language="vb" runat="server">
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Not IsPostBack Then
                Me.BasicDatePicker1.SelectedDate = DateTime.Now
            End If
        End Sub
 
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
            Response.Write(Me.BasicDatePicker1.SelectedDate.ToString())
        End Sub
    </script>
</head>
<body>
<form runat="server">
<p>
    <bdp:BasicDatePicker ID="BasicDatePicker1" runat="server" timepicker="TimePicker1"/>
    <bdp:TimePicker ID="TimePicker1" runat="server" />
</p>
<p><asp:Button ID="Button1" runat="server" onclick="Button1_Click" text="Button"></asp:Button></p>
</form>
</body>
</html>
    
[CS]
<%@ Page language="c#" @>
<%@ Register TagPrefix="bdp" Namespace="BasicFrame.WebControls" Assembly="BasicFrame.WebControls.BasicDatePicker" @%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>TimePicker</title>
    <script language="C#" runat="server">
        private void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.BasicDatePicker1.SelectedDate = DateTime.Now;
            }
        }
 
        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Write(this.BasicDatePicker1.SelectedDate);
        }
    </script>
</head>
<body>
<form runat="server">
<p>
    <bdp:BasicDatePicker ID="BasicDatePicker1" runat="server" timepicker="TimePicker1"/>
    <bdp:TimePicker ID="TimePicker1" runat="server" />
</p>
<p><asp:Button id=Button1 runat="server"  onclick="Button1_Click" Text="Button"></asp:Button></p>
</form>
</body>
</html>
    

See Also

BasicDatePicker Class | BasicFrame.WebControls Namespace | TimePicker.SelectedTime | SelectedDate