-2

I want to add an image next to the text in a dropdownlist control but it doesn't work for me. Where is the problem?

<asp:DropDownList ID="drpRoomSetup" runat="server">
     <asp:ListItem>Select a style</asp:ListItem>
     <asp:ListItem  style="background-image:url(U.GIF);">U 
      style</asp:ListItem>
      <asp:ListItem  style="background-
     image:url(Classroom.GIF);">Small rectangular table/chairs)
    </asp:ListItem>
</asp:DropDownList>
Cœur
  • 37,241
  • 25
  • 195
  • 267
user788448
  • 779
  • 1
  • 14
  • 36

1 Answers1

0

This works in html. Hope it answers your question.

<select>
    <option value="volvo" style="background-image:url(images/volvo.png);">Volvo</option>
    <option value="saab"  style="background-image:url(images/saab.png);">Saab</option>
    <option value="honda" style="background-image:url(images/honda.png);">Honda</option>
    <option value="audi"  style="background-image:url(images/audi.png);">Audi</option>
</select>

Check out this link if you need it for a different scenario Click Here

CodeNinja
  • 26
  • 7