Hello,
I am trying to select Date OF Birth on a WEB FORM from three DropdownList control like YEAR MONTH and DAY respectively, I want that when i select month FEBRUARY then the DAY dropdownlist control should list the no .of day according to YEAR i mean if it is leap year bla bla bla.
For this I m using AJAX cascading dropdown where i am not getteing response. The following are the code and webservices where DAY dropdown gets disabled becasue it doesnot get the value selected from YEAR or MONTH dropdown.
Can anybody see this and let me know
''''''''''''''''''''''.aspx code
'''''Web services code...............
When i RUN this project i can see that YEAR MONTH are doing fine but DAY remains disabled even if i change month from the list.
Can u please ahve a look where is the problem.
Thanx and Kind Regards
nsoni
I am trying to select Date OF Birth on a WEB FORM from three DropdownList control like YEAR MONTH and DAY respectively, I want that when i select month FEBRUARY then the DAY dropdownlist control should list the no .of day according to YEAR i mean if it is leap year bla bla bla.
For this I m using AJAX cascading dropdown where i am not getteing response. The following are the code and webservices where DAY dropdown gets disabled becasue it doesnot get the value selected from YEAR or MONTH dropdown.
Can anybody see this and let me know
''''''''''''''''''''''.aspx code
HTML:
<asp:DropDownList ID="ddlDOByear" runat="server" ></asp:DropDownList>
<asp:DropDownList ID="ddlDOBmon" runat="server"></asp:DropDownList>
<asp:DropDownList ID="ddlDOBday" runat="server"></asp:DropDownList>
<ajaxToolkit:CascadingDropDown id="CascadingDropDown1" runat="server" category="Year" prompttext="Year" ServiceMethod="GetDOBYears" ServicePath="WebService.asmx" TargetControlId="ddlDOByear" />
<ajaxToolkit:CascadingDropDown id="CascadingDropDown2" runat="server" category="MONTH" prompttext="Month" ServiceMethod="GetDOBMonths" ServicePath="WebService.asmx" TargetControlId="ddlDOBmon" />
<ajaxToolkit:CascadingDropDown id="CascadingDropDown3" runat="server" category="Day" LoadingText="Loading Days...." prompttext="Days" ServiceMethod="GetDOBDays"
ServicePath="WebService.asmx" TargetControlId="ddlDOBday" />
'''''Web services code...............
VB.NET:
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Collections
Imports System.Collections.Generic
Imports System.Collections.Specialized
Imports AjaxControlToolkit
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://nerdliness.com/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WebService
Inherits System.Web.Services.WebService
Public imon As Integer
<WebMethod()> _
Public Function GetDOBYears(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
Dim i As New Long
Dim txtyrs As String
Dim mydobyear As New List(Of CascadingDropDownNameValue)
For i = 1 To 90
txtyrs = ""
txtyrs = Year(Now()) - i
mydobyear.Add(New CascadingDropDownNameValue(txtyrs, txtyrs))
Next
Return mydobyear.ToArray
End Function
<WebMethod()> _
Public Function GetDOBMonths(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
Dim txtmon As String
Dim mydobmonth As New List(Of CascadingDropDownNameValue)
For imon = 1 To 12
txtmon = ""
txtmon = MonthName(imon)
mydobmonth.Add(New CascadingDropDownNameValue(txtmon, imon))
Next
Return mydobmonth.ToArray
End Function
<WebMethod()> _
Public Function GetDOBDays(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
Dim i As Long
Dim txtdays As String
Dim totday As Long
Dim kvDays As StringDictionary = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)
Dim intMonthid As Integer
If Not kvDays.ContainsKey("MONTH") Or Not Int32.TryParse(kvDays("MONTH"), intMonthid) Then
Return Nothing
End If
Dim mydobday As New List(Of CascadingDropDownNameValue)
If intMonthid = 0 Then
totday = 31
Else
totday = 30
End If
For i = 1 To totday
txtdays = ""
txtdays = i
mydobday.Add(New CascadingDropDownNameValue(txtdays, txtdays))
Next
Return mydobday.ToArray
End Function
End Class
When i RUN this project i can see that YEAR MONTH are doing fine but DAY remains disabled even if i change month from the list.
Can u please ahve a look where is the problem.
Thanx and Kind Regards
nsoni