RSS LOGORss   Welcome Guest  Login Register
Welcome to our Blogs
Back Back

2008/06/08 02:44PM
Sharepoint DateTimeControl      Number of views: 2450

There was somekind of error when I tried to get the SelectedDate property from a SharePoint DateTimeControl, so, after alot of investigation which I could not solve it, but, I got that the control has inner child controls so, I tried to obtain the date value in the Text box which was rendered as (SPCompositeControl)

string DateTo = ((TextBox)((Microsoft.SharePoint.WebControls.SPCompositeControl)(dtVacationTo)).Controls[0]).Text;
newitem["VacationStartDate"] = DateTime.Parse(DateFrom, new System.Globalization.CultureInfo("ar-EG")) ;
Hope it helps,