You must Sign In to post a response.
  • Category: JavaScript

    DropDownlist

    i have one dropdownlist. its have 10 city name.particular city name should be display in different colors(Using JavaScript).its very urgent.

    Advacne thanks
    By
    Nathan
  • #260901
    you can try by setting the style property as follows

    <asp:DropDownList ID="ddlCityName" runat="server" Font-Bold="True" ForeColor="Red">
    <asp:ListItem>Hyd</asp:ListItem>
    <asp:ListItem style="color:black;font-weight:bold;">Sec</asp:ListItem>
    </dropdownList>

    or else even in .cs you can give as follows

    if (DropDownList1.Items[4].Value == "444444444")
    DropDownList1.Items[4].Attributes.Add("style ", "color:green;font-weight:bold;");


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.