This is a migrated thread and some comments may be shown as answers.

Newbie Question About SelectedImageUrl

4 Answers 69 Views
Menu
This is a migrated thread and some comments may be shown as answers.
David Bruce Muir
Top achievements
Rank 2
David Bruce Muir asked on 20 Jul 2009, 01:22 PM
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!

4 Answers, 1 is accepted

Sort by
0
ManniAT
Top achievements
Rank 2
answered on 20 Jul 2009, 01:50 PM
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
0
Accepted
Paul
Telerik team
answered on 20 Jul 2009, 02:06 PM
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.
0
David Bruce Muir
Top achievements
Rank 2
answered on 20 Jul 2009, 02:19 PM
Thank you both very much for your replies.

FTR, I do use MasterPages.  :)
0
ManniAT
Top achievements
Rank 2
answered on 20 Jul 2009, 02:23 PM
Hi,

yes you do use MPs -- my stupid tool has hidden the ctl00_ from the names :)
Tags
Menu
Asked by
David Bruce Muir
Top achievements
Rank 2
Answers by
ManniAT
Top achievements
Rank 2
Paul
Telerik team
David Bruce Muir
Top achievements
Rank 2
Share this question
or