Question

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 ?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top