开发者

How to show images in dropdownlist options?

开发者 https://www.devze.com 2022-12-11 00:31 出处:网络
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 :

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

精彩评论

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