DateTimeControl Class (Microsoft.SharePoint.WebControls)
DateTimeControl Class (Microsoft.SharePoint.WebControls)
Represents a DateTime control.

Namespace: Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Syntax

'Usage

Dim instance As DateTimeControl


'Declaration

<DefaultPropertyAttribute("Text")> _
<ToolboxDataAttribute("<{0}:DateTimeControl runat=server></{0}:DateTimeControl>")> _
<DesignerAttribute(GetType(SPControlDesigner))> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel:=True)> _
Public Class DateTimeControl
    Inherits SPCompositeControl
    Implements IValidator, IPostBackDataHandler, IDesignerEventAccessor
Inheritance Hierarchy

System.Object
   System.Web.UI.Control
     Microsoft.SharePoint.WebControls.SPCompositeControl
      Microsoft.SharePoint.WebControls.DateTimeControl
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also

Community Content

Bug: DateTimeControl loses state of Hour during postback
Added by:Louis de Klerk

This DateTimeControl loses state during postback, specifically of the Hour.

More specifically, if this DateTimeControl control is used in a WebPart, and a different WebPart on the same page causes a postback, this DateTimeControl loses the previously chosen hour. (The date and minute are correctly kept, only the hour is lost, and defaulted to 12:00am)

Lets hope a fix for this is forthcoming.

Bug: Min & Max Date functionality
Added by:Andrew N Jacks

Setting the Minimum and Maximum date ranges does not always provide the expected results.

Setting a date to have a minimum date restricts a date being selected in the calandar view, but allows the user to actually enter a prior date.

Setting a maximum date does not appear to provide any restrictions at all.

The calendar view's default date cannot be set and defaults to Today. This is annoying when the minimum date has been set to the future.

It would be great if this control could be reviewed and changed to work as expected so that the end user can have a more pleasurable experience.

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View