Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET 2.0, setting the ImageUrl value, how???

Reply
Thread Tools

ASP.NET 2.0, setting the ImageUrl value, how???

 
 
Jeff
Guest
Posts: n/a
 
      02-21-2007
Hey

ASP.NET 2.0

I'm working on a website which I want the menu control to have images to
left for the text in the menuitem... So far I've read that this can be done
by providing the ImageUrl for the menuitem with a URL to the specific image.

The problem is that I don't know how to set this ImageUrl value for every
menuitem. I'm using a .sitemap where all the menuitems are specified. And
also I want this property in ImageUrl to be defined by Theme - My website
comes with different themes, the user can select the theme he wants. Then it
could be cool if the image in ImageUrl could vary depending on selected
Theme!

Any suggestions?

Below is example content of my .sitemap file and the menu markup

Menu markup:
<asp:Menu ID="MyMenu"
runat="server"
DataSourceID="smdsMyMenu"
MaximumDynamicDisplayLevels="2"
Orientation="Vertical"
StaticDisplayLevels="2"
StaticMenuItemStyle-CssClass="menuitem"
OnMenuItemDataBound="mnuSidebar_MenuItemDataBound" >

<levelmenuitemstyles>
<asp:menuitemstyle CssClass="MenuHeadline"/>
<asp:menuitemstyle BackColor="White" forecolor="Blue"/>
</levelmenuitemstyles>

</asp:Menu>
<asp:SiteMapDataSource ID="smdsMyMenu"
runat="server"
SiteMapProvider="MyMenu"
ShowStartingNode="false"
StartingNodeOffset="0" />

Sitemap:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="#" title="My Menu" description="">
<siteMapNode url="1" title="sub item 1" description="">
<siteMapNode url="2" title="sub item 2" description="" />
<siteMapNode url="3" title="sub item 3" description="" />
<siteMapNode url="4" title="sub item 4" description="" />
<siteMapNode url="5" title="sub item 5" description="" />
</siteMapNode>
</siteMapNode>
</siteMap>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ImageURL setting pvong ASP .Net 2 12-12-2008 12:48 PM
1.1: Setting ImageUrl of ImageButton does not work DC ASP .Net 2 07-30-2007 01:56 PM
setting an image control imageurl and displaying picture Aussie Rules ASP .Net 2 07-26-2006 07:49 PM
setting ImageUrl for images through code not working mich_stone@yahoo.com ASP .Net 2 12-09-2004 07:12 AM
Hyperlink w/ImageUrl bug? Leigh Kendall ASP .Net 8 08-19-2003 01:47 PM



Advertisments