tags:

views:

16

answers:

0

hi, i am using ajax calendar.in that, on pageload i am displaying current system date. my problem is when i click on other date and on submitting form,the date is taking system date instead of new date. my code,

protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            txtEnd.Text = Convert.ToString(System.DateTime.Now.Date);
            var days = System.DateTime.Today.Day;
            var mon = System.DateTime.Today.Month;
            var year = System.DateTime.Today.Year;
            txtEnd.Text = mon + "/" + days + "/" + year;
            DateTime dt = System.DateTime.Today;
            dt = dt.AddDays(-7);
            var days2 = dt.Day;
            var mon2 = dt.Month;
            var year2 = dt.Year;
            txtstart.Text = mon2 + "/" + days2 + "/" + year2;
        }               

   var endDate = txtEnd.Text;
           }

can anybody find error.