SqlDataSource with DropDownList Control Parameter doesn't read value

crypt0night

New Member
I have a drop down list that bound to a SqlDataSource.I have another drop down list that's bound to a different SqlDataSource.The second SqlDataSource has the first drop down as a Control Parameter.I'm trying to do this...\[code\]<asp:SqlDataSource ID="sqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM Test WHERE Param = @param;" CancelSelectOnNullParameter="true"> <SelectParameters> <asp:ControlParameter ControlID="dropDown1" Name="param" PropertyName="SelectedValue" ConvertEmptyStringToNull="true" /> </SelectParameters></asp:SqlDataSource>dropDown1.SelectedValue = "http://stackoverflow.com/questions/15579167/someValue"dropDown2.DataBind()\[/code\]but I don't get any results. However, if I set the second SqlDataSource's Control Parameter to a text box, it works. For example, this works:\[code\]<asp:ControlParameter ControlID="txt" Name="param" PropertyName="Text" ConvertEmptyStringToNull="true" />txt.Text = "someValue"dropDown2.DataBind()\[/code\]Any ideas why this is?
 
Back
Top