images in sitemap in

Posted on 2011-04-19
Last Modified: 2012-05-11
I developed an application, in that i used sitemap control for navigation and it is working fine, but the problem is i could not apply images/icons for the navigation links. I dont know the reason why i could not use that, so please help me in this.
i followed these links -

and i tried with the following code to apply the images -

<siteMapNode url="default.aspx" title="Home"  description="The home page" imageUrl="home.gif">

thanks in advance
Question by:CPSRI
    LVL 38

    Accepted Solution

    Did you try this?

    <siteMapNode url="default.aspx" title="&lt;img src='home.gif' style='vertical-align:middle; border:none'&gt;Home"  description="The home page">
    LVL 12

    Expert Comment

    try this on the menu page accordding to the second link.  It work for my master page with no title if image is specified for

        <siteMapNode url="Default.aspx" title="Home"  description="The Home Page" imageURL="~/images/home.gif"/>

    I use root reference for the image path..
    Private Sub MnMenu_MenuItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles MnMenu.MenuItemDataBound
        Dim imageUrl As String = CType(e.Item.DataItem, SiteMapNode)("imageUrl")
        If String.IsNullOrEmpty(imageUrl) = False Then
          e.Item.ImageUrl = imageUrl
          e.Item.Text = ""
        End If
      End Sub

    Open in new window


    Author Comment

    thanks tommyboy and CmdoProg2, for your replies, let me try with the both comments and ill get back to you

    Author Closing Comment

    Thank you . Thank you Very Much
    LVL 38

    Expert Comment

    by:Tom Beck
    You're welcome, glad it worked for you. Thanks for the points.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now