[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Assembly: TimePicker (in TimePicker.dll)
protected void Page_Load(object sender, EventArgs e)
{
List<DateTime> list = new List<DateTime>();
list.Add(DateTime.Now);
list.Add(DateTime.Now.AddSeconds(30));
list.Add(DateTime.Now.AddMinutes(30));
Control that allows you to display a time picker in the same format as the Windows XP clock settings view.
Namespace:
MKB.TimePickerAssembly: TimePicker (in TimePicker.dll)
Syntax
C# | Visual Basic | Visual C++ |
[ValidationPropertyAttribute("Date")] public class TimeSelector : WebControl, IPostBackEventHandler, IPostBackDataHandler, IScriptControl
<ValidationPropertyAttribute("Date")> _ Public Class TimeSelector _ Inherits WebControl _ Implements IPostBackEventHandler, IPostBackDataHandler, IScriptControl
[ValidationPropertyAttribute(L"Date")] public ref class TimeSelector : public WebControl, IPostBackEventHandler, IPostBackDataHandler, IScriptControl
Members
All Members | Constructors ![]() | Properties ![]() | Methods ![]() | Explicit Interface Implementations ![]() |
![]() ![]() | ![]() ![]() ![]() | ![]() ![]() | ![]() ![]() ![]() ![]() |
Member | Description | |
---|---|---|
![]() | TimeSelector()()() |
Constructor initializes control as HtmlTextWriterTag.Span
|
![]() | AddJavaScript()()() |
Registers and inserts a javascript client script block that handles time changes from the user
|
![]() | AllowSecondEditing |
Determines whether or not seconds are a factor in this control. If set to false, the second will always be 00.
|
![]() | AmPm |
Returns the AM/PM value
|
![]() | BuildCSS()()() |
Builds and inserts a style client script block to style the control
|
![]() | DataBind()()() | |
![]() | Date |
DateTime value. Defaults to current day if not set. Otherwise, maintains a value of the date assigned plus time shown.
|
![]() | DisplaySeconds |
Determines whether or not this control displays the seconds slot in the browser.
|
![]() | EnableClock |
Enables ticking clock-like functionality.
|
![]() | FindControl()()() | |
![]() ![]() | IScriptControl..::.GetScriptDescriptors()()() | |
![]() ![]() | IScriptControl..::.GetScriptReferences()()() | |
![]() | getTimePartString(Int32, TimeSelector..::.TimePartType) |
Gets a string representation of the time with leading 0's in number less than 10
|
![]() | Hour |
Returns the current hour value. 1-12.
|
![]() | LoadPostData(String, NameValueCollection) | |
![]() ![]() | IPostBackDataHandler..::.LoadPostData(String, NameValueCollection) | |
![]() | Minute |
Returns the current minute value. 0-59.
|
![]() | MinuteIncrement |
Determines how many minutes are added or subtracted from the minute slot when a user clicks the up and down arrows.
|
![]() | OnLoad(EventArgs) | (Overrides Control..::.OnLoad(EventArgs).) |
![]() | OnPreRender(EventArgs) | (Overrides Control..::.OnPreRender(EventArgs).) |
![]() | RaisePostBackEvent(String) | |
![]() ![]() | IPostBackEventHandler..::.RaisePostBackEvent(String) | |
![]() | RaisePostDataChangedEvent()()() | |
![]() ![]() | IPostBackDataHandler..::.RaisePostDataChangedEvent()()() | |
![]() | ReadOnly |
Determines whether or not this control is editable by a user within a browser.
|
![]() | Render(HtmlTextWriter) | (Overrides WebControl..::.Render(HtmlTextWriter).) |
![]() | RenderContents(HtmlTextWriter) | (Overrides WebControl..::.RenderContents(HtmlTextWriter).) |
![]() | RenderControl()()() | |
![]() | Second |
Returns the current second value. 0-59.
|
![]() | SecondIncrement |
Determines how many seconds are added or subtracted from the second slot when a user clicks the up and down arrows.
|
![]() | SelectedTimeFormat |
Gets or sets the 12/24 time format preference
|
![]() | SetTime(Int32, Int32, TimeSelector..::.AmPmSpec) |
Preset to an hour and a minute such as 2:30 PM
|
![]() | SetTime(Int32, Int32, Int32, TimeSelector..::.AmPmSpec) |
Preset to an hour and a minute such as 2:30 PM
|
Examples
Controls defined declaratively:
<MKB:timeselector ID="TimeSelector1" runat="server" MinuteIncrement="15" />
<asp:Label ID="lblTS1" runat="server" Text="Postback value: " BackColor="#FFFF99" Width="359px" />
<MKB:TimeSelectorAvailabilityValidator ID="TimeSelectorAvailabilityValidator1"
runat="server" ControlToValidate="TimeSelector1" Display="Dynamic" ErrorMessage="That time is already taken!" />
protected void Page_Load(object sender, EventArgs e)
{
List<DateTime> list = new List<DateTime>();
list.Add(DateTime.Now);
list.Add(DateTime.Now.AddSeconds(30));
list.Add(DateTime.Now.AddMinutes(30));
TimeSelectorAvailabilityValidator1.AppointmentList = list;
TimeSelectorAvailabilityValidator1.AppointmentLengthInMinutes = 90;
}
protected void Button1_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
lblTS1.Text = TimeSelector1.Date.ToLongDateString() + ", " + TimeSelector1.Date.ToLongTimeString();
}
}
Inheritance Hierarchy
System..::.Object
System.Web.UI..::.Control
System.Web.UI.WebControls..::.WebControl
MKB.TimePicker..::.TimeSelector
System.Web.UI..::.Control
System.Web.UI.WebControls..::.WebControl
MKB.TimePicker..::.TimeSelector