title: How to only allow selection of dates two week from current date in a calendar?
body: <p>I'm using asp.net Calendar control and I want to enable people to only select dates that are two weeks from the current date.</p>
  
  <p>E.g. today's date is 06/01/2015. Can only select dates 20/01/2015 onwards. So if they select a date like 19/01/2015, it'll say error.</p>
  
  <p>I've tried </p>
  
  <pre><code> if ( Calendar1.SelectedDate &lt; DateTime.Now.AddDays(14)){
  
        Label8.Text = "*You can only select a date two weeks from now.";
        Label8.Visible = true;
     }
  </code></pre>
  
  <p>But there's an error. I've also tried the solution in </p>
  
  <p><a href="https://stackoverflow.com/questions/9500882/asp-net-calendar-control-date-selectable-after-2-days-from-the-current">asp.net calendar control. Date selectable after 2 days from the current</a></p>
  
  <p>but the error is the same.</p>
  
  <blockquote>
    <p>Error  1   'ASP.reservations_aspx' does not contain a definition for 'Calendar1_SelectionChanged' and no extension method 'Calendar1_SelectionChanged' accepting a first argument of type 'ASP.reservations_aspx' could be found (are you missing a using directive or an assembly reference?) </p>
  </blockquote>
  
  <p>Any help would be appreciated!</p>
  
  <p>-I'm using VS 2013, web form.   </p>