private SPDatePickerControl _myDateField;
protected override void CreateChildControls()
{
base.CreateChildControls();
_myDateField = new SPDatePickerControl();
_myDateField.Calendar = SPCalendarType.Gregorian;
_myDateField.SelectedDate =
DateTime.Today.ToLongDateString();
this.Controls.Add(_myDateField);
}
The Datepicker controls shows up all fine but as soon as I start to
invorke the control by clicking "Next Month" or "Previous Month"
nothing happens except I recieve an javascript error (Object Expected
Line 1 - Char 1) ..
Why ??
writer.Write("<script type=\"text/javascript\"
src=\"/_layouts/datepicker.js\"></script>");
ALSO: you must include the Style sheet:
writer.Write("<link rel=\"stylesheet\" type=\"text/css\"
href=\"/_layouts/1033/styles/datepicker.css\" />");
--
David M. Sterling
Author MOSS 2007 The Complete Reference
www.sterling-consulting.com