Your code works as designed. Have you tried
debugging[
^]? Set a breakpoint on the first line and step through your code and watch the values:
txtBirthdate.Attributes["max"]
= "2017-11-08"
BirthDate
= {8/11/2017 12:00:00 AM}
CurrentDate
= {8/11/2017 12:00:00 AM}
Age
= 0
Now do you see, using debugging, what is actually happening in your code?