Validation ASP.Net Tutorial

<%@ Page Language="VB" %>

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        RangeValidator1.MinimumValue = DateTime.Now.ToShortDateString()
        RangeValidator1.MaximumValue = DateTime.Now.AddDays(14).ToShortDateString()
    End Sub
    
    Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, _
      ByVal e As System.EventArgs)
        TextBox1.Text = Calendar1.SelectedDate.ToShortDateString()
    End Sub
    Protected Sub Button1_Click(ByVal sender As Object, _
      ByVal e As System.EventArgs)
        If Page.IsValid Then
            Label1.Text = "You are set to arrive on: " & TextBox1.Text
        End If
    End Sub



    Date Validation Check


    
        Arrival Date:
         
                                    ErrorMessage="select a date within the next two weeks." 
                            ControlToValidate="TextBox1" 
                            Type="Date"/>
        
        Select your arrival date:
                              runat="server" 
                      OnSelectionChanged="Calendar1_SelectionChanged">
        
                            runat="server" 
                    Text="Button" 
                    OnClick="Button1_Click" />