Friday, October 10, 2008

SharePoint Date Picker Control

This explains how to use the date picker control that SharePoint provides. This example uses it in a web part.


DateTimeControl dtcBegin;
DateTimeControl dtcEnd;
dtcBegin = new DateTimeControl();
dtcEnd = new DateTimeControl();

And to reference the selected date do this:

System.DateTime start = dtcBegin.SelectedDate;
System.DateTime end = dtcEnd.SelectedDate;

1 comment:

electronic signature said...

You just made something that I thought was so difficult be, truly, so easy! Thanks for the post!