<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:TextBox ID="txtDate" runat="server" />
    <asp:ImageButton runat="server" ID="imgPopup" ImageUrl="~/Images/Calendar.png" />
    <cc1:CalendarExtender ID="CalendarExtender1" OnClientDateSelectionChanged="DateSelectionChanged"
        runat="server" TargetControlID="txtDate" PopupButtonID="imgPopup" />
    <script type="text/javascript">
        function DateSelectionChanged(e) {
            var today = new Date();
            var dob = e.get_selectedDate();
            var months = (today.getMonth() - dob.getMonth() + (12 * (today.getFullYear() - dob.getFullYear())));
            alert("Your age: " + Math.round(months / 12));
        }     
    </script>
    </form>
</body>
</html>