How to set default date for the calender control in asp.net

2.6k Views Asked by At

How to set Calender Control to 1 week past from the current date in asp.net web application to get data from Database to Gridview

1

There are 1 best solutions below

0
On BEST ANSWER

In the pageload(or whereever need in event life cycle), write the following snippet: (Assuming the id of the calender control to be:

protected void Page_Load(object sender, EventArgs e)
    {
    calenderSagar.SelectedDate=DateTime.Now.AddDays(-8);
    }