I have two dropdownlist. In first dropdownlist have to pass only static values as mentioned below.Based on first dropdownlist value the second dropdownlist should automatically list corresponding values. After that Gridview should load.
<asp:DropDownList ID="DDL1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DDL1_SelectedIndexChanged">
<asp:ListItem Value="%">All</asp:ListItem>
<asp:ListItem Value="Test1">Test1</asp:ListItem>
<asp:ListItem Value="Test2">Test2</asp:ListItem>
<asp:ListItem Value="Test3">Test3</asp:ListItem>
</asp:DropDownList>
Follow these steps.
Create an event handler for first dropdownlist
Example:
Then in the second dropdownlist event handler, Let it’s name is DDL2