asp.netvisual-studio-2010c#-4.0ado.netcalendar-control

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


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


Solution

  • 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);
        }