Asp.net ajax 错误500-CascadingDropDown AJAX Extender toolkit控件

Asp.net ajax 错误500-CascadingDropDown AJAX Extender toolkit控件,asp.net-ajax,.net-2.0,cascadingdropdown,Asp.net Ajax,.net 2.0,Cascadingdropdown,我正在尝试使用CascadingDropDown填充3个下拉列表。DDLs分别显示汽车的品牌、型号和颜色。数据驻留在.xml文件中 <br /> <br /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:DropDownList ID="DropDownList1" runa

我正在尝试使用CascadingDropDown填充3个下拉列表。DDLs分别显示汽车的品牌、型号和颜色。数据驻留在.xml文件中

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>
最后一个DDL的AutoPostBack=true,我试图在一个标签控件中显示下拉列表中的值

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>
我正在从Web服务中提取数据以填充DDL。编译时我没有收到任何错误,但当我运行代码时,它显示错误500。我不确定我会错在哪里。我正在观看“我该怎么做”的教程视频-

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>
我正在使用C#和.Net framework 2.0

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>
我的Web服务如下所示-

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>
[WebService(名称空间=”)] [WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1)] [System.Web.Script.Services.ScriptService()] 公共类CarsService:System.Web.Services.WebService{

public XmlDataDocument _document;
//public object _lock = new Object();
public CarsService () {

    //Uncomment the following line if using designed components 
    //InitializeComponent(); 
}

public XmlDocument Document
 {
     get
     {
         if (_document==null)
         {
             _document = new XmlDataDocument();
             _document.Load(HttpContext.Current.Server.MapPath("~/App_Data/CarsService.xml"));
         }
         //Document = _document;
         return _document;
     }
 }

public string[] Hierarchy
{
    get
    {
        string[] hierarchy = {"make","model"};
        return hierarchy;
    }

}

[WebMethod]
public AjaxControlToolkit.CascadingDropDownNameValue[] GetDropDownContents(string knowncategoryvalues, string category)
{
    StringDictionary knownCategoryValuesDictionary = new StringDictionary();
    knownCategoryValuesDictionary = AjaxControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knowncategoryvalues);

    return  AjaxControlToolkit.CascadingDropDown.QuerySimpleCascadingDropDownDocument(Document, Hierarchy, knownCategoryValuesDictionary, category);

}
    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>
}

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>
网页看起来是这样的-

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>
无标题页

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>















    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>
在此处附加xml文件-

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>
我不确定我会错在哪里。您能帮助我吗?

对于调试web服务调用非常有用

    <br />
    <br />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList2" runat="server" Width="147px">
            </asp:DropDownList>
            <br />
            <asp:DropDownList ID="DropDownList3" runat="server" Width="147px" 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" Height="64px" Width="191px"></asp:TextBox>
            <br />
            <br />
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                Category="make" PromptText="Please enter dish name" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList1" 
                ServicePath="CarsService.asmx">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" 
                Category="model" LoadingText="[Loading price...]" 
                ParentControlID="DropDownList1" PromptText="Please select price" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList2">
            </ajaxToolkit:CascadingDropDown>
            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" 
                Category="color" LoadingText="[Loading Description...]" 
                ParentControlID="DropDownList2" PromptText="Select Description" 
                ServiceMethod="GetDropDownContents" TargetControlID="DropDownList3">
            </ajaxToolkit:CascadingDropDown>
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</form>
  • 安装Firefox的Firebug插件
  • 在Firefox中打开测试网页
  • 打开Firebug,然后打开Net选项卡并单击XHR
  • 再次尝试下拉列表,并在XHR响应中查找错误

  • 我试过了。但是我不明白它在哪里卡住了。如果您关闭了customErrors mode(),您应该在XHR响应中看到完整的堆栈跟踪。