if you using data-binding on your page, and the sub category is related to the value from first drop down, there is too many way to implement.
easiest way is use a datasource like SQLdatasource, and use smart tag, and add a where clause state to your selection with a parameter from your first drop down selected value or other source like session,route,... like this:
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:testConnectionString %>"
SelectCommand="SELECT * FROM [orders] WHERE ([status_id] = @status_id)">
<SelectParameters>
<asp:ControlParameter ControlID="ddl1" DefaultValue="1" Name="status_id"
PropertyName="SelectedValue" Type="Int32" />
or you can use OnSelectedIndexChanged event for first databind, look at this code snipped:
protected void ddl1_SelectedIndexChanged(object sender, EventArgs e)
{
var ds = (from a in DB.orders where status_id == ddl1.SelectedValue select a).ToList();
ddl2.DataSource = ds;
}
Next is use Linq DataSource and on selecting event handle your binding logic like this:
protected void linqds_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
e.Result = (from a in DB.orders where status_id == ddl1.SelectedValue select a).ToList();
}