I am using an UpdatePanel with an entire table in the content template. Within this update panel, I have dropdown A that calls a javascript function on its onchange event that sets the display CSS property of another control to none depending on the selected value of the dropdown list. It works as expected. However, I have dropdown B that invokes a SelectedIndexChanged which populates dropdown C with a set of values. That part also works. The problem is that, when dropdown B’s servside event is invoked, all the HTML within the content template appears to be reset, causing the control that I had previously hidden via CSS to show again.
What I would like to do is have dropdown B update only dropdown C and nothing else. If I were using Telerik’s RadAjaxManager then I could do this with ease, but we don’t have that =. Does the ASP update panel support what I want to do?
Note: Don’t worry, I won’t delete my question this time around 🙂
First, you need to set your UpdatePanel to update in conditional mode:
Then, after the event has been executed, you need to update the UpdatePanel you want in the codebehind:
In this way you could have more than 1 UpdatePanel, which will improve the performance since they are handling different events (and less content).