Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • dalecam 20 posts 20 karma points
    Jan 27, 2009 @ 03:38
    dalecam
    0

    Include an asp.net image in XSLT Navigation

    Hi all,
    I am using an image inside my navigation, so currently my xslt looks like this:
    [code]




    [/code]

    However using a static image like this gets into problems when i go into a page inside a folder - obviously then the image url is incorrect. So how can i fix this? I tried adding an asp image control but it tells me asp is not defined so im not sure how to define asp in the xslt script or even if it is the right solution! Any ideas would be really appreciated!
    Thanks in advance for your time!

    Dale

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 27, 2009 @ 08:08
    Dirk De Grave
    0

    Hi Dale,

    Replace

    [code][/code]

    with

    [code][/code]

    Or did I misunderstand the question?

    Regards,
    /Dirk

  • dalecam 20 posts 20 karma points
    Jan 27, 2009 @ 20:45
    dalecam
    0

    Hi Dirk,
    and thanks again. For some reason that fixes it, but i cant understand how it works the same for http://localhost/welcome.aspx and say: http://localhost/Articles/2009/ArticleList.aspx
    because the image link in the latter page would be pointing to : http://localhost/Articles/2009/images/Key-trans.png wouldn't it?
    Thanks and sorry for any ignorance on my belhalf if its something very simple - ive only "umbracoded" for 2 weeks now!

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 27, 2009 @ 20:49
    Dirk De Grave
    0

    Hi dalecam,

    If you start the src attribute with a slash '/', then it starts looking for the image from the root, no matter what page is requested. It will always start looking at the root of the web.

    It's not limited to src attribute of img's, it does so for href attributes on a tags.

    Btw: this is not umbraco, this is just plain vanilla web stuff. It's just how those things work.

    Regards,
    /Dirk


  • dalecam 20 posts 20 karma points
    Jan 27, 2009 @ 20:52
    dalecam
    0

    Wow - I had no idea!
    Thanks heaps dirk. Maybe in 5 years time i might be able to return that favour and answer one of your questions (if you ever have any!)
    Regards,
    Dale

Please Sign in or register to post replies

Write your reply to:

Draft