Community discussion forum

Images in Dropdown list

Tags: asp India
  • 1 year ago

    Hi Friends,

    How add images to a dropdownlist using ASP. 

    Awaiting for your favarable reply......

    Thanks and Regards,

    Smiley Face [:)] SudhaThangaraj

     

  • Advertisement

    Simply the fastest line-level profiler for .NET ever

    “The low overhead means it has minimal impact on the execution of my program”
    Mark Everest, Development Team Leader, Renault F1 Team Ltd.

    Try out the new ANTS Profiler 4 for yourself. Download your 14-day trial now

  • 1 year ago

    simply with styles man ...

     

    <

    select id="Select1" style="width: 270px">

    <option selected="selected" value="1" style="background-image: url(myWebsite/images/first01.gif);">opt01</option>

    <option value="2">opt02</option>

    <option value="3">opt03</option>

    <option></option>

    </select>

     

    Serval

  • 1 year ago

    Hi,

    This is not working out.....

    Any way thanks.....

    Smiley Face [:)] Sudha











  • 1 year ago

    Sorry .
    the "select" tag is one of the few tags on which the background-image style does not work ..

    I've found this .. may be you can try ?

     

    http://www.csharpfr.com/codes/LISTBOX-AVANC-201_29583.aspx

     

    Serval

     

  • 3 months ago

     <head runat="server">
         <style type="text/css">
        .test1{background-repeat:no-repeat; background-position:right; background-image: url(images/AmEx.gif); vertical-align:middle; margin-top:4px; margin-bottom :4px; margin-right :8px;}
        .test2{background-repeat:no-repeat; background-position:right; background-image: url(images/Visa.gif); vertical-align:middle; margin-top:4px; margin-bottom :4px; margin-right :8px;}
         </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <asp:DropDownList ID="cmbCardType" runat="server" CssClass="cmbCardTypeAnonims" Width ="200px">
                    <asp:ListItem Text="Visa" Value="VIS" class="test1"></asp:ListItem>
                    <asp:ListItem Text="Visa" Value="VIS" class="test2"></asp:ListItem>
                </asp:DropDownList>
            </div>
        </form>
    </body>

     

    try it, it works...........

Post a reply

Enter your message below

Sign in or Join us (it's free).