日期:2014-05-17  浏览次数:20558 次

我使用CascadingDropDown方式做了三个DropDownList, 如何回绑数据?
即: 如做做一个界面aspx, 要同时实现对数据的新增和编缉都共用这个界面, 那么当编辑时, 我如何能使该dropDownList控件显示数据库中的值?
像一般的DorpDownList可以用DDl.Items.FindByValue(需要选值项).Selected = true;的方法做到, 但是用CascadingDropDown方式做的话,好像不行的..
HTML code
 HTS Code:<asp:DropDownList ID="ddl_HTS_Code" runat="server" CssClass="verdana10pt">
                                            <asp:ListItem Text="-Select-" Value="-1"></asp:ListItem>
                                        </asp:DropDownList>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTS
                                        SubCode:<asp:DropDownList ID="ddl_HTS_SubCode" runat="server" CssClass="verdana10pt">
                                            <asp:ListItem Text="-Select-" Value="-1"></asp:ListItem>
                                        </asp:DropDownList>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        HTS Name:<asp:DropDownList ID="ddl_HTS_Name" runat="server" CssClass="verdana10pt">
                                            <asp:ListItem Text="-Select-" Value="-1"></asp:ListItem>
                                        </asp:DropDownList>
                                        
                                        <ajaxToolKit:CascadingDropDown ID="cdd_HTS_Code" runat="server" TargetControlID="ddl_HTS_Code"
                                            Category="HTS_Code" PromptText="-Select-" LoadingText="[Loading data...]" ServicePath="HTS.asmx"
                                            ServiceMethod="Get_HTS_Code">
                                        </ajaxToolKit:CascadingDropDown>
                                        <ajaxToolKit:CascadingDropDown ID="cdd_HTS_SubCode" runat="server" TargetControlID="ddl_HTS_SubCode"
                                            Category="HTS_SubCode" PromptText="-Select-" LoadingText="[Loading data...]"
                                            ServicePath="hTS.asmx" ServiceMethod="Get_HTS_SubCode" ParentControlID="ddl_HTS_Code">
                                        </ajaxToolKit:CascadingDropDown>
                                        <ajaxToolKit:CascadingDropDown ID="cdd_HTS_Name" runat="server" TargetControlID="ddl_HTS_Name"
                                            Category="HTS_Name" PromptText="-Select-" LoadingText="[Loading data...]" ServicePath="HTS.asmx"
                                            ServiceMethod="Get_HTS_Name" ParentControlID="ddl_HTS_SubCode">
                                        </ajaxToolKit:CascadingDropDown>


------解决方案--------------------
我没这么做过 帮顶一下