开发者

How to show images in dropdownlist options?

I need to have a dropdownlist whose options contains text followed by a small image.

Suppose I have a drop开发者_开发百科downlist of fruits. I want to show the options as :

Option 1 : small Image of mango then text Mango

Option 2 : small Image of orange then text Orange .....................

Is it possible to implement in asp.net 2.0?

If yes then please help with sample code.

I don't want to use JQuery.


You can do that server side by just placing <asp:Image ImageUrl="some.gif" /> tags in your ASP.NET code. The browser will show them when the page is loaded.


You don't need to use JQuery, use CSS background-image property for every <option>.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜