code behind If Trim(txtBirthDate.Text) = "" Then Else Dim textboxdate As Date = Convert.ToDateTime(txtBirthDate.Text).Date Dim todaysdate As Date = DateTime.Now.Date If textboxdate >= todaysdate Then datelabel.Visible = True datelabel.Text = "Birth date must Not be greater than today's Date" flag = False End If End If code in front