ASP.NET : Linqing to a drop down box

I have a small web app I’m writing and trying to teach myself ASP.NET at the same time.

I have a three-tiered hierarchal database structure that I’m trying to access; You pick the first level from the first drop box, selections then appear in the next and then in the third.

Problem is … it doesn’t work all the time. Half the time the third level won’t show the new data and half the time it will. I’ve been unable to detect any consistent point that would indiccate a problem.

What should I be looking at?

Hard for me to say off the top of my head without seeing code specifics.

What are you using to cause data binding on the second and third drop down list boxes? If you’re using an event like SelectedIndexChanged on the first DDL you should slap some breakpoints into your code and make sure that event is actually firing when you think it is.

A lot of things that you could consider:

-Bad markup (improper nesting et cetera) can sometimes break the functionality of ASP.Net controls; although in my experience this would cause an “always broken” not a “intermittently broken” situation.

-See if you can find any absolutes with this. For example does it always not populate the second and third DDLs when you select a SPECIFIC item in the first DDL?

As an example of what I’m saying imagine a DDL with three ListItems; is there a specific ListItem that always causes the behavior you expect and then specific ListItems that never cause the behavior you expect? If that is the case then you’d be well on your track to figuring out what the problem is. Usually if something only works for a specific ListItem in a DDL it means there is a problem with either the way you are populating the DDL, or a problem with the underlying data not working with your set up.