Author: Robbaralla | Posted on: 4/6/2010 9:41:31 AM | Views : 358

Hello there,
I have the scenario, where in a userControl on the masterPage I have a dropdownlist that gets its datasource in code behind and from another filtering dropdownlist. After submitting it is then preSelected (through its dataBound event) with the right value that it gets from a querystring.
All seems to work as expected until its filtering dropdownlist gets a null value.

Schematically the scenario is like this

<usercontrol>
DropDownListTown  bound to sql datasource - postback = true
DropDownListType bound in code behind - postback = false
buttonSubmit
</usercontrol>
 
in the usercontrol.cs :

 
page_load  -- gives ddlType a default datasource
 
ddlTown_SelectedIndexChanged --  filters the ddlType datasource for their existence in 'town"
 
ddlTown_DataBound  -- gives the ddlTown ...

Go to the complete details ...