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

Discussion in 'ASP .Net' started by Jeff, Feb 21, 2007.

  1. Jeff

    Jeff Guest

    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>
    Jeff, Feb 21, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    5,950
    aa7im
    Dec 9, 2004
  2. Nick Gilbert
    Replies:
    1
    Views:
    548
    Nick Gilbert
    Feb 28, 2006
  3. Aussie Rules
    Replies:
    2
    Views:
    641
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 26, 2006
  4. DC
    Replies:
    2
    Views:
    982
  5. pvong

    ImageURL setting

    pvong, Dec 11, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    368
    S. Justin Gengo
    Dec 12, 2008
Loading...

Share This Page