Menu control and images

  • Thread starter Thread starter fredd00
  • Start date Start date
F

fredd00

Hi

I'm trying to use the menu control but o would like ot use images
instead of text.
I can't get it to work.

I can't find much info on the Menu databindings editor , wich i think
that's the place where i will set up my image and navigate info.

I could do it with an item template, but i still need the binding.

other wise could it be possible to configure the width of each menu
item so that they are all equal width and that the mouse over happens
on the cell and not on the text link only

thanks for your input
 
Hi,

a Menu can't show individual icons per menu item. A menu item doesn't
have a property to store this information. You can put HTML in the Text
property of a menu item, and thus you can place an image in there using
the img tag. Use the following web.sitemap file to try it out. (you can
use the Value property to store the key for your menu item).

Grtz, Wouter

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="&lt;img src='blah'&gt;"
description="">

</siteMapNode>
</siteMap>
 
Looks like it should work

my problem now is i use :

<siteMapNode url="default.aspx" title="&lt; img
src='~/images/Home.jpg'&gt;" description=""/>

in web.sitemap

and the text is being displayed :< img src='~/images/Home.jpg'> not the
image

any clues why

thanks
 
You are only missing the end forward slash '/' before the closing tag '>' :
This works for me which displays both an image and the text 'Members':

<siteMapNode title="<img src='Images/icon_usergroup.gif'
style='border-style:none' /> Members" url="IE/Members.aspx" />
 
Noticed two shortcomings with this approach...

1) a breadcrumb gets screwed as it now displays the html for <img.... not
very good.

2) having the pages in the menu on different physical folder levels makes
the images not being displayed when navigating to a page on another level.

Any suggestions to this? I would like to extend the sitemap, building a
custom provider for it, but don't know how to... Overkill?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top