Posted on: 10/9/2012 12:10:17 AM | Views : 407

Hi all,
I have one problem here. first, in my page i put one textbox for date of birth. then, second textbox for age. When user select date in dob textbox, automatically will display age in age textbox. My problem is when I select 31/10/1983. the age is not display. I use this code for dob textbox:
Protected Sub PPDob_TextChanged(sender As Object, e As System.EventArgs) Handles PPDob.TextChanged Try Dim d As DateTime = Convert.ToDateTime(PPDob.Text) Dim age As Integer = DateTime.Now.Year - d.Year PPAge.Text = age.ToString() & "Y" 'PPAge.Text = age.ToString() Catch ex As Exception Response.Write("Not a valid Date!") End Try End Sub -----------
<asp:TextBox ID="PPDob" runat="server" AutoPostBack="True" ...

Go to the complete details ...