I've got 2 controls on a page, one for a request date and another for the date of birth of a client. Both of these values come from a SQL Server database. During the Page_Loaded event I had been trying to calculate the age of the client on the request date, however that's not working. For some reason, which I don't understand, the date of birth of the client is wrong (it turns out to be today's date), during the Page_Loaded event. However, once the page is actually displayed, it is correct. I had thought Page_Loaded would have been the correct event to put this code, but that doesn't seem to be the case.
So, where should I put the age calculation code? In what event?
The XAML for the first control is:
and the XAML for the second control is here:
So, where should I put the age calculation code? In what event?
The XAML for the first control is:
<
telerik:RadMaskedDateTimeInput
Name
=
"radReqDate"
MinWidth
=
"80"
TabIndex
=
"0"
FontWeight
=
"Bold"
Value
=
"{Binding RequestDate}"
InputBehavior
=
"Replace"
TextMode
=
"PlainText"
SelectionOnFocus
=
"SelectAll"
ValueChanged
=
"radReqDate_ValueChanged"
/>
and the XAML for the second control is here:
<
telerik:RadMaskedDateTimeInput
Name
=
"radDOB"
EmptyContent
=
"Enter DOB"
MinWidth
=
"80"
TabIndex
=
"14"
FontWeight
=
"Bold"
InputBehavior
=
"Replace"
TextMode
=
"PlainText"
Value
=
"{Binding Path=DateOfBirth, Mode=TwoWay}"
ValueChanged
=
"radDOB_ValueChanged"
/>