Sunday, March 11, 2012

CascadingDropDown getting the item.count

Hi,

It's hard to say where the exact cause lying on, Maybe you should do more Javascript debuging to find out it.

Can you show me a simple repro?

Thanks


Are you checking on the server, or in javascript? The object is being updated in javascript, and uses a different mechanism to maintain state on the server that's not tied to the normal object control model as far as I can tell.

On the client, you want to get a reference to the html select element in question, then check its length property (e.g. myList.length), which tells you the current number of options it has.

Not sure what the method to check on the server is, because currently they don't update the server with the list of values, only with the one selected. See here:http://ajax.asp.net/ajaxtoolkit/Walkthrough/CCDWithDB.aspx

One thought is to do that checking in javascript, because if javascript is disabled then your controls won't have the cascading dropdown behavior anyway.


Hi

Good Answer!

No comments:

Post a Comment