예제 #1
0
        protected void btnCalculate_Click(object sender, EventArgs e)
        {
            DateOfBirth dob = new DateOfBirth();

            if (dob.IsValidDate(txtDate.Text.ToString()))
            {
                lblAge.Text = $"You are a {ddlGender.SelectedValue} and your age is {dob.ShowAge()}";
            }
            else
            {
                lblAge.Text = "Please enter valid value";
            }
        }