Hey,
I've searched the forums for a solution but can't seem to find one that will work. I have a radmenu in a masterpage and when I go to a page I need the selected item to display an image (a:focus in stylesheet) just like when it's hovered over. The problem is the master page is refreshed each time a new page is accessed. I tried the code below, but didn't work with the code I have. Any help would be greatly appreciated.
I've pasted in all of the relavent code below ( I think ).
radmenu code from masterpage
sitemap - I can use the menu.xml format if needed. whatever works.
CSS - appied to div containing the radmenu
I've searched the forums for a solution but can't seem to find one that will work. I have a radmenu in a masterpage and when I go to a page I need the selected item to display an image (a:focus in stylesheet) just like when it's hovered over. The problem is the master page is refreshed each time a new page is accessed. I tried the code below, but didn't work with the code I have. Any help would be greatly appreciated.
if (!IsPostBack) { RadMenu1.LoadContentFile("menu.xml"); } RadMenuItem item = RadMenu1.FindItemByUrl(Request.Url.PathAndQuery); if (item != null) { item.CssClass = "Focused"; }I've pasted in all of the relavent code below ( I think ).
radmenu code from masterpage
<telerik:RadMenu ID="RadMenu1" Runat="server" CssClass="menuNav" EnableAjaxSkinRendering="False" EnableEmbeddedSkins="False" DataSourceID="SiteMapDataSource1" > </telerik:RadMenu>sitemap - I can use the menu.xml format if needed. whatever works.
<?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="" title="" description=""> <siteMapNode url="Doctors.aspx" title="Doctors" description="" /> <siteMapNode url="Testimonials.aspx" title="Testimonials" description="" /> <siteMapNode url="Departments.aspx" title="Departments" description="" /> <siteMapNode url="Contact.aspx" title="Contact Us" description="" /> </siteMapNode> </siteMap>CSS - appied to div containing the radmenu
.menuNav /*radmenu class- not used*/ { } #navigationDiv a, #navigationDiv a:visited { height:37px; text-decoration:none; color:#0069aa; } #navigationDiv a:hover, #navigationDiv a:active, #navigationDiv a:focus { height:37px; background-image:url(images/hoverImage.jpg); background-position:center; background-repeat:no-repeat; color:#0069aa; }