i am using ajaxcontrolkit in my project , only use its calender
but problem is that after selected a date from calender when i press
submit button after reload he show the same default date which is
current day date not my selected date and also in my server side code
when i pick date from textbox it also give me the default current date
not the selected date
please any body know about this problem, tell me thanks
Loading
shahidPosted Aug 31, 2008, 8:55 AM
Guest UserPosted Aug 19, 2008, 5:34 PM
protected void Button1_Click(object sender, EventArgs e)
{
DateTime date = Convert.ToDateTime(tb_select_date.Text);
CalendarExtender1.SelectedDate = date; // add this line
}
Guest UserPosted Aug 19, 2008, 5:32 PM
shahidPosted Aug 19, 2008, 4:20 PM
if (!IsPostBack)
{
CalendarExtender1.SelectedDate = DateTime.Now.Date;
DateTime date = DateTime.Now.Date;
tb_select_date.Text = date.Date.ToShortDateString();
GenerateEmployeeList(date);
}
and button click code is this
protected void Button1_Click(object sender, EventArgs e)
{
DateTime date = Convert.ToDateTime(tb_select_date.Text);
GenerateEmployeeList(date);
}
html page
this html page code is enclose in a contentplaceholder master page
Guest UserPosted Aug 19, 2008, 2:30 PM
Page_Load()
{
if (!IsPostBack)
{
DateControl.SelectedDate = DateTime.Today;
}
}