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.
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.
I've tried
if ( Calendar1.SelectedDate < DateTime.Now.AddDays(14)){
Label8.Text = "*You can only select a date two weeks from now.";
Label8.Visible = true;
}
But there's an error. I've also tried the solution in
asp.net calendar control. Date selectable after 2 days from the current
but the error is the same.
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?)
Any help would be appreciated!
-I'm using VS 2013, web form.