Questions Ask questions on Kentico CMS 4.0 BETA or RC. This forum is closed.
Version 4.0 BETA and RC > Questions > CMSListMenu - Changing RenderedHTML View modes: 
User avatar
tcontosta-reflexdt - 1/30/2009 10:11:07 AM
CMSListMenu - Changing RenderedHTML

I have a CMSListMenu in a user control:

<kentico:CMSListMenu runat="server" ID="lmPrimaryNav" Path="/%" DisplayHighlightedItemAsLink="true" HighlightAllItemsInPath="true" LastItemCssClass="last" Visible="true" RenderLinkTitle="true" RenderImageAlt="true" RenderSubItems="true" />

I have images setup for the off and on states of the navigation elements in this menu. I have the images labeled as nav-x-{0}-off.gif. Before the control renders, {0} will be replaced by a predetermined 3-character code based on the section that the user is in. This is needed because the navigation colors are different depending on what section the use is in.

I have tried to replace the rendered HTML by placing this line in places such as Page_Load(), On_PreRender() and OnInit():

lmPrimaryNav.RenderedHTML = lmPrimaryNav.RenderedHTML.Replace("{0}", SectionClassName);

However, the {0}'s are still showing up in the code, even though I have debugged and verified that the RenderedHTML property was successfully changed.

I have tried using lmPrimaryNav.ReloadData(false) after setting the RenderedHTML, but that doesn't seem to work.

I wanted to try and use a CMS menu rather than "rolling my own". If anybody has any information on how this can be done, I would appreciate it.