<asp:DropDownList ID="drpProduct" runat="server" Width="104%" Style="margin-top: -4.2%; margin-left: 16px"> <asp:ListItem Value="--Select Product--"></asp:ListItem> <asp:ListItem Value="All">All Product</asp:ListItem> <asp:ListItem Value="Cotton S6">Cotton S6</asp:ListItem> <asp:ListItem Value="Cotton S5">Cotton S5</asp:ListItem> <asp:ListItem Value="Stone x 1">Stone x 1</asp:ListItem> <asp:ListItem Value="Stone x 2">Stone x 1</asp:ListItem> </asp:DropDownList> <asp:Button ID="btnSearch" runat="server" CssClass="btn green" Text="Search" ValidationGroup="val" UseSubmitBehavior="false" OnClick="btnSearch_Click" />
lblProduct.Text = drpProduct.SelectedValue;
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // bind your dropdown here } } protected void btnSearch_Click(object sender, EventArgs e) { Response.Write(drpProduct.SelectedValue); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)