<div class="labelerror"> <asp:Label ID="lblMessage" runat="server" Text=""></asp:Label> </div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <div class="boxcolwideroute" runat ="server" id="Idboxcolwideroute"> <asp:DropDownList ID="ddlRoute" runat="server" attr-identity="ddlRoute" CssClass="aspcombobox"> <asp:ListItem Value="-1">--Select--</asp:ListItem> </asp:DropDownList> <asp:ImageButton runat="server" ID="imageAdd" ImageUrl="~/Images/add_16.png" Style="width: 16px" OnClick="imageAdd_Click" /> </div>
<div class="boxcolroute" runat="server" id="Idboxcolroute"> <span class="lbltxt">Selected Routes</span> <span class="validation">*</span> </div> <div class="boxcolwide2" runat="server" id="Idboxcolwide2"> <%-- <asp:DropDownList ID="ddlroutes" runat="server" attr-identity="ddlRoute" CssClass="aspcombobox"> <asp:ListItem Value="-1">--Select--</asp:ListItem> </asp:DropDownList>--%> <asp:ListBox ID="lstRoutes" runat="server" SelectionMode="Multiple"></asp:ListBox> <asp:ImageButton runat="server" ID="imgCancel" ImageUrl="~/Images/minus_16.png" Style="width: 16px" OnClick="imgCancel_Click" /> </div> </ContentTemplate> </asp:UpdatePanel>
if (lstRoutes.Items.Count > 0 && lstRoutes.SelectedIndex >= 0) { for (int i = 0; i < lstRoutes.Items.Count; i++) { if (lstRoutes.Items[i].Selected) { lstRoutes.Items.Remove(lstRoutes.Items[i]); i--; } } if (lstRoutes.Items.Count > 0) lstRoutes.SelectedIndex = 0; } else lblMessage.Text = "No Route Selected";
<asp:Label runat="server" ID="lblMessage"></asp:Label>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)