Drop-Down List Filled with Images in ASP.NET?
How do I make a drop-down list that is filled with image items? I want to be able to see a list of images in the list with text titles, be able to select one exclusive开发者_运维技巧ly, and have the text title appear in the selection box on top of the list. Does anyone know how this can be accomplished?
The most straightforward way to do this is to use a 3rd party library such as Telerik's ASP.NET AJAX library (commonly referred to as Rad Controls).
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/templates/defaultcs.aspx
I have had good luck with Telerik. One nice thing about the RadComboBox (their full-featured drop down list for ASP.NET) is that it allows you to override the rendering of every item in the list if you wish. By overriding the rendering of each item, you may put any kind of HTML into the drop down list (including images, tables, etc). So it is pretty powerful.
The down-side is that it is a commercial product and there is a bit of a learning curve. Also, Telerik controls can be a little heavy depending upon your requirements.
I don't have experience with other 3rd party libraries with this level of functionality, so there may be other solutions out there.
精彩评论