for asp.net control see
http://msdn.microsoft.com/en-us/library/add3s294(v=VS.85).aspx[
^]
for ajax control an example:
cePickDateStart.Format = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
cePickDateFinish.Format = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
if (!IsPostBack)
{
if (!cePickDateStart.SelectedDate.HasValue)
cePickDateStart.SelectedDate = DateTime.Now.AddMonths(-1).AddDays(-DateTime.Now.Day+1);
if (!cePickDateFinish.SelectedDate.HasValue)
cePickDateFinish.SelectedDate = DateTime.Now.AddDays(-DateTime.Now.Day + 1);
txtPickDateStart.Text = cePickDateStart.SelectedDate.Value.ToShortDateString();
txtPickDateFinish.Text = cePickDateFinish.SelectedDate.Value.ToShortDateString();
LoadUserPageVisits();
}
else
{
cePickDateStart.SelectedDate = Convert.ToDateTime(txtPickDateStart.Text);
cePickDateFinish.SelectedDate = Convert.ToDateTime(txtPickDateFinish.Text);
}