[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


images in sitemap in asp.net

Posted on 2011-04-19
Medium Priority
Last Modified: 2012-05-11
I developed an asp.net 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
  • 2
  • 2
LVL 38

Accepted Solution

Tom Beck earned 2000 total points
ID: 35426714
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

ID: 35426916
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

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

Author Closing Comment

ID: 35791343
Thank you . Thank you Very Much
LVL 38

Expert Comment

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Integration Management Part 2
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

867 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