문제

CascadingDropdown using a webmethod to retrieve items from a db that populate the parent dropdown.

<asp:DropDownList ID="ddlAssignDept" runat="server"/>
                        <ajaxToolkit:CascadingDropDown ID="cddAssignDept" runat="server" 
                            TargetControlID="ddlAssignDept" Category="Department" 
                            PromptText="Select a Department" ServicePath="~/services/srv_Cascading.asmx" 
                            ServiceMethod="GetDepartment" Enabled="True" />

My Problem: At run time, under certain circumstances, I need to add a new list item to this dropdown. I cannot find where in the page life cycle to do this.

My question is: At what time in the page life cycle does the binding occur. From my testing, it appears to be one of the very last events.
How can I add a list item at run time to the dropdown ?

도움이 되었습니까?

해결책

Found the answer in another StackOverflow post

Ajax Toolkit CascadingDropDown onload event?

The key is adding a handler for the cascading dropdown's add_populated event.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top