Newbie Question About SelectedImageUrl

5 posts, 1 answers
  1. David Bruce Muir
    David Bruce Muir avatar
    2 posts
    Member since:
    Nov 2008

    Posted 20 Jul 2009 Link to this post

    Hello,

    I'm making the move from ComponentArt to Telerik and have a very novice question, but it's still something I can't seem to get worked out.

    I'm trying to create a RadMenu that leaves the menu item for the page I'm currently on highlighted or selected.  I had assumed I could do this using SelectedImageUrl, but it doesn't seem to work.  Here's my code:

    <

     

    telerik:RadMenu ID="RadMenu1" runat="server" DefaultGroupSettings-OffsetY="-1" EnableEmbeddedSkins="False">

     

     

    <DefaultGroupSettings OffsetY="-1"></DefaultGroupSettings>

     

     

    <Items>

     

     

    <telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavCollections_Off.jpg" HoveredImageUrl="~/images/pnavCollections_On.jpg"

     

     

    NavigateUrl="/Collections.aspx"

     

     

    SelectedImageUrl="~/images/pnavCollections_On.jpg">

     

     

    </telerik:RadMenuItem>

     

     

    <telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavYourSkin_Off.jpg" HoveredImageUrl="~/images/pnavYourSkin_On.jpg"

     

     

    NavigateUrl="/Your-Skin.aspx"

     

     

    SelectedImageUrl="~/images/pnavYourSkin_On.jpg">

     

     

    </telerik:RadMenuItem>

     

     

    <telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavWhyShea_Off.jpg" HoveredImageUrl="~/images/pnavWhyShea_On.jpg"

     

     

    NavigateUrl="/Why-Shea.aspx"

     

     

    SelectedImageUrl="~/images/pnavWhyShea_On.jpg">

     

     

    </telerik:RadMenuItem>

     

     

    <telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavFAQ_Off.jpg" HoveredImageUrl="~/images/pnavFAQ_On.jpg"

     

     

    NavigateUrl="/FAQ.aspx" SelectedImageUrl="~/images/pnavFAQ_On.jpg">

     

     

    </telerik:RadMenuItem>

     

     

    <telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavWheretoBuy_Off.jpg" HoveredImageUrl="~/images/pnavWheretoBuy_On.jpg"

     

     

    NavigateUrl="/Where-to-Buy.aspx"

     

     

    SelectedImageUrl="~/images/pnavWheretoBuy_On.jpg">

     

     

    </telerik:RadMenuItem>

     

     

    <telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavNewsEvents_Off.jpg" HoveredImageUrl="~/images/pnavNewsEvents_On.jpg"

     

     

    NavigateUrl="/News-Events.aspx"

     

     

    SelectedImageUrl="~/images/pnavNewsEvents_On.jpg">

     

     

    </telerik:RadMenuItem>

     

     

    </Items>

     

    </

     

    telerik:RadMenu>

     


    And here's a live example of this menu in the website I am currenly building: http://treehut.beyondigital.com/

    So for example, if you visit http://treehut.beyondigital.com/Collections.aspx, I'd like for this image to be selected: pnavCollections_On.jpg

    Any help would be greatly appreciated!
  2. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 20 Jul 2009 Link to this post

    Hi,

    what you produce with your markup are "good looking" hyperlinks. But the menu gets no feedback where you are (on which page).
    The easiest way to achieve what you want is to use a sitemap - and a sitemapdatasource for the menu.

    A different approach would be to set the menuitem in CodeBehind a selected.

    Or (as I see you don't use masterpages) simply set that one item of the menu to selected.
    I think you have the menu on every page (duplicated).
    So locate the item for the current page and do Selected="true".

    Regards

    Manfred
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Paul
    Admin
    Paul avatar
    4281 posts

    Posted 20 Jul 2009 Link to this post

    Hi David,

    Please refer to our Menu / Show Path And BreadCrumb example that shows the needed approach.

    All the best,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. David Bruce Muir
    David Bruce Muir avatar
    2 posts
    Member since:
    Nov 2008

    Posted 20 Jul 2009 Link to this post

    Thank you both very much for your replies.

    FTR, I do use MasterPages.  :)
  6. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 20 Jul 2009 Link to this post

    Hi,

    yes you do use MPs -- my stupid tool has hidden the ctl00_ from the names :)
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017