amillyard
asked on
2 sql database driven drop-down lists to link up
Development plaform: C# ASP.net 2.x, SQL 2005, MS Visual Studio Pro using Web Developer, IIS 6
Hi there,
I am trying to get these 2 sql database driven drop-down lists to link up.
i.e. depending on what the first drop-down list option is select will determine what the second drop-down list will display. Essentially, fire-up another sql search for related records etc.
Below is the shell of the program -- these 2 sql-based drop-down menus are working fine independately -- just need to get them to link up.
Could someone please add to this scripting the additional coding I need to consider in order to get it working?
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSourc e1"
DataTextField="LeadSourceP roviderNam e" DataValueField="LeadSource Provider_I D">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSourc e2"
DataTextField="LeadSourceP roviderPro ductName" DataValueField="LeadSource ProviderPr oducts_ID" >
</asp:DropDownList><br />
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:FORTUNEC onnectionS tring %>"
SelectCommand="SELECT [LeadSourceProvider_ID], [LeadSourceProviderName] FROM [LeadSourceProviders] ORDER BY [LeadSourceProviderName]">
</asp:SqlDataSource>
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:FORTUNEC onnectionS tring %>"
SelectCommand="SELECT [LeadSourceProviderProduct s_ID], [LeadSourceProviderProduct Name], [LeadSourceProvider_ID] FROM [LeadSourceProviderProduct s] ORDER BY [LeadSourceProviderProduct Name]">
</asp:SqlDataSource>
Thank you in advance for your time and efforts with this enquiry.
Hi there,
I am trying to get these 2 sql database driven drop-down lists to link up.
i.e. depending on what the first drop-down list option is select will determine what the second drop-down list will display. Essentially, fire-up another sql search for related records etc.
Below is the shell of the program -- these 2 sql-based drop-down menus are working fine independately -- just need to get them to link up.
Could someone please add to this scripting the additional coding I need to consider in order to get it working?
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSourc
DataTextField="LeadSourceP
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSourc
DataTextField="LeadSourceP
</asp:DropDownList><br />
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:FORTUNEC
SelectCommand="SELECT [LeadSourceProvider_ID], [LeadSourceProviderName] FROM [LeadSourceProviders] ORDER BY [LeadSourceProviderName]">
</asp:SqlDataSource>
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:FORTUNEC
SelectCommand="SELECT [LeadSourceProviderProduct
</asp:SqlDataSource>
Thank you in advance for your time and efforts with this enquiry.
AutoPostaback should be set to true in the first Dropdownlist
ASKER
ok, done that -- but this is not making the 2nd dro-down box react any differently, only that the screen page refreshes.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
100 % spot on -- apprieate your time and efforts with enquiry.
thank you.
thank you.
You welcome :-)