2014-11-06 59 views
0

我有这些DropDownLists:级联的DropDownList在不触发任何

<li> 
    <label>State:</label> 
    <asp:DropDownList ID="ddlState" runat="server" Width="356px" 
     DataTextField="State" DataValueField="StateId" /> 
    <cc1:CascadingDropDown ID="cdlState" TargetControlID="ddlState" PromptText="State" 
     PromptValue="" ServicePath="~/Forms/General/DropWS.asmx" ServiceMethod="getState" runat="server" 
     Category="StateProvider" LoadingText="Loading..." /> 
</li> 
<li> 
    <label>City:</label> 
    <asp:DropDownList ID="ddlCity" runat="server" Width="356px" DataTextField="City" DataValueField="CityId" /> 
    <cc1:CascadingDropDown ID="cdlCity" TargetControlID="ddlCity" PromptText="City" 
     PromptValue="" ServicePath="~/Forms/General/DropWS.asmx" ServiceMethod="GetCity" runat="server" 
     Category="CityProvider" ParentControlID="ddlState" LoadingText="Loading..." /> 
</li> 

第一个下拉已经开始弥漫着的国家。

我也创建了WebService来获取数据。它正在工作,因为我debbuged的Web服务,它给了我的XML与正确的数据。

但是,当我运行程序时,我可以选择任何状态都没有发生,城市没有被填充。

我错过了什么?

回答

1

If u r getting Correct in XML file then the problem is that point where you append that data

few steps...

  1. Run your program
    1. right click on screen select inspect Element
    2. click on "Console"
    3. there should be an error on the event where u append data
+0

的错误是在这里:遗漏的类型错误:“无法读取未定义的属性“UI”... 可能是错误的:$ create(Sys.Extended.UI.CascadingDropDownBehavior – Mucida 2014-11-06 19:10:43

1

现在它的工作...

错误:

Uncaught TypeError: "Cannot read property 'UI' of undefined"

固定更换:

<asp:ScriptManager> with <ajaxToolkit:ToolkitScriptManager>