title: Selecting multiple dates across multiple months in the asp calendar
body: <p>I have encountered the following issue with asp calender.</p>
  
  <p>Currently, I am able to select multiple dates within the range (which I have set) which is within 1 month. However I am unable to get the correct selected dates if my range is within 2 months (cross month).</p>
  
  <p>Within 2 months:</p>
  
  <p>If my calendar displays at the 1st month, I can still gets the dates from the 2 months but may have duplication dates on the 2nd months.</p>
  
  <p>If my calendar display at the 2nd month, I am only able to get dates from the 2nd month.</p>
  
  <p>Any advise for the above issue? Thanks in advance~ =)</p>
  
  <pre><code>protected void CalendarMain_DayRender(object sender, DayRenderEventArgs e)
          {
              DateTime minDate, maxDate;
              if (!tbStartDate.Text.Equals("") &amp;&amp; !tbEndDate.Text.Equals(""))
              {
  
                  minDate = Convert.ToDateTime(tbStartDate.Text);
                  maxDate = Convert.ToDateTime(tbEndDate.Text);
  
                  if (e.Day.Date &lt; minDate || e.Day.Date &gt; maxDate)
                  {
                      e.Day.IsSelectable = false;
                  }
  
                  if (e.Day.Date &gt;= minDate &amp;&amp; e.Day.Date.Date &lt;= maxDate)
                  {
                      e.Cell.BackColor = Color.FromName("#3f97ab");
                  }
  
  
              }
  
              DataTable dtgv = Session["dtSelectedDateData"] as DataTable;
              if (dtgv != null)
              {
  
                  foreach (DataRow drr in dtgv.Rows)
                  {
                      string DateValue = drr["Time_Start"].ToString();
  
                      if (e.Day.Date.ToString("dd/MM/yyyy") == DateValue.Substring(0, 10))
                      {
                          e.Cell.ForeColor = System.Drawing.Color.Pink;
                          e.Day.IsSelectable = false;
  
                      }
                  }
              }
              if (e.Day.IsSelected == true)
              {
  
                  PatientsSchedule.listDatetime.Add(e.Day.Date);      
              }
              Session["SelectedDate"] = PatientsSchedule.listDatetime;
          }
  
  public static List&lt;DateTime&gt; listDatetime = new List&lt;DateTime&gt;();
  </code></pre>