I have a 3 dropdownlist and a gridview to display..
What i want is if i load the page i want all the dropdownlist and the
Gridview to get populated and linked on the fly.
But my problem now is when i load the page i want all the dropdownlist
should be populated and linked automatically.
but it doesn't .The first 2 works the last dropdownlist is empty and the
gridview shows nothing..
Any ideas what 'm doing wrong?
All the 3 dropdownlist are linked like so below
<table>
<p>
<tr>
<td>
Select a Dealer
</td>
<td>
<asp:DropDownList ID="ddlDealer" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource4"
DataTextField="dealer" DataValueField="dealer">
</asp:DropDownList>
<asp:Label ID="Label1" runat="server"></asp:Label>
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$
ConnectionStrings:cn %>"
SelectCommand="spGetDealer"
SelectCommandType="StoredProcedure"></asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
Select a Master Code
</td>
<td>
<asp:DropDownList ID="ddlMaster" runat="server"
DataSourceID="SqlDataSource1" DataTextField="Master_Code"
DataValueField="mc_id"
OnSelectedIndexChanged="ddlMaster_SelectedIndexCha nged"
AutoPostBack="true">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:cn %>"
SelectCommand="[spGetAllScheduleMaster]"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="ddlDealer" Name="dealer"
PropertyName="SelectedValue"
Type="string" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
Select a Plan Value
</td>
<td>
<asp:DropDownList ID="ddlPlans" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource2"
DataTextField="Plan Code" DataValueField="plan_id"
OnDataBound="ddlPlans_DataBound">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$
ConnectionStrings:cn %>"
SelectCommand="spGetPlanValuesByID" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="ddlMaster" Name="mc_id"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>