Hi,
I Downloaded Ajax control yesterday. Im trying to get the cascadingdropdown working
I added the carsservice.xml to my app_data folder just like the sample,
On my form i add 1 combobox and the cascadingdropdown control
The properties i set for the cascadingdropdown looks like this
<cc1:CascadingDropDown ID="CascadingDropDown1" runat="server" TargetControlID="DropDownList1" PromptText="Select..." ServiceMethod="GetDropDownContentsPageMethod" Category="make">
</cc1:CascadingDropDown>
My Code behind looks like this
<WebMethod()> _
Public Function GetDropDownContentsPageMethod(ByVal knownCategoryValues As String, ByVal category As String) As AjaxControlToolkit.CascadingDropDownNameValue()
Dim cs As New GetCodeBlock
Return cs.GetDropDownContents(knownCategoryValues, category)
End Function
The code in the webservice file looks like this
Shared _Document As New XmlDocument
Shared _Lock As New Object
Public ReadOnly Property Document() As XmlDocument
Get
_Document = Nothing
If (_Document Is Nothing) Then
SyncLock _Lock
_Document = New XmlDocument
_Document.Load(HttpContext.Current.Server.MapPath("~/App_Data/CarsService.xml"))
End SyncLock
End If
Document = _Document
Exit Property
End Get
End Property
Public ReadOnly Property Hierarchy() As String()
Get
Dim _Hierarchy As String() = {"make", "model"}
Return _Hierarchy
End Get
End Property
<WebMethod()> _
Public Function GetDropDownContents(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
Dim knownCategoryValuesDictionary As New StringDictionary
knownCategoryValuesDictionary = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)
Return CascadingDropDown.QuerySimpleCascadingDropDownDocument(Document, Hierarchy, knownCategoryValuesDictionary, category)
End Function
When I run the page the combobox displays the Select... and no options except for
[Method Error 500]
Please HELP