Partial Class Input Inherits System.Web.UI.Page Protected Sub DDL_BirthMonth_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DDL_BirthMonth.SelectedIndexChanged Dim iMonth As Integer = CInt(DDL_BirthMonth.Text) Dim i As Integer DDL_BirthDay.Items.Clear() Select Case iMonth Case 2 For i = 1 To 29 Dim j As New ListItem(i) DDL_BirthDay.Items.Add(j) Next Case 1, 3, 5, 7, 8, 10, 12 For i = 1 To 31 Dim j As New ListItem(i) DDL_BirthDay.Items.Add(j) Next Case 4, 6, 9, 11 For i = 1 To 30 Dim j As New ListItem(i) DDL_BirthDay.Items.Add(j) Next End Select End Sub Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then Dim i As Integer Dim j As New ListItem(i) Dim iYear As Integer iYear = Now().Year For i = iYear To iYear - 100 Step -1 j = New ListItem(i) DDL_BirthYear.Items.Add(j) Next For i = 1 To 31 j = New ListItem(i) DDL_BirthDay.Items.Add(j) Next End If End Sub Protected Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click Dim iBY As Integer = CInt(DDL_BirthYear.Text) Dim iBM As Integer = CInt(DDL_BirthMonth.Text) Dim iBD As Integer = CInt(DDL_BirthDay.Text) Dim M, N As Integer Dim i, j, A(4) As Integer M = iBY + iBM + iBD While M >= 10 N = M For i = 0 To 3 A(i) = N Mod 10 N = Math.Floor(N / 10) Next M = 0 For i = 0 To 3 M += A(i) Next End While Session("BY") = DDL_BirthYear.Text Session("BM") = DDL_BirthMonth.Text Session("BD") = DDL_BirthDay.Text Session("V") = M.ToString() Response.Redirect("Result.aspx") 'Response.Write(M.ToString()) End Sub End Class