I have the following DropDownList control:
<asp:label runat="server" text="Filter by state: "></asp:label> <asp:dropdownlist runat="server" id="filterbystate" OnSelectedIndexChanged="FilterByState"> <asp:ListItem value="all" selected="True">All</asp:ListItem> <asp:ListItem value="ca" selected="False">California</asp:ListItem> <asp:ListItem value="co" selected="False">Colorado</asp:ListItem> <asp:ListItem value="id" selected="False">Idaho</asp:ListItem> <asp:ListItem value="ut" selected="False">Utah</asp:ListItem> </asp:dropdownlist>
Here is a way:
protected void FilterByState(object sender, EventArgs e) { var value = e; }
For some reason, the method does not work. I choose a different value and nothing happens. What I'm trying to do is reload the page by passing a status value so that I can filter the results.
What am I doing wrong?
James wilson
source share