Microsoft.SharePoint.WebCon ...


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

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

Visual Basic (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
Visual Basic (Usage)
Dim instance As DateTimeControl
C#
[DefaultPropertyAttribute("Text")] 
[ToolboxDataAttribute("<{0}:DateTimeControl runat=server></{0}:DateTimeControl>")] 
[DesignerAttribute(typeof(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 : SPCompositeControl, 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

Tags :


Community Content

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

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.


Andrew N Jacks
Bug: Min & Max Date functionality

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.


Page view tracker