You can set OutputCache only for the menu control simply by putting the Telerik RadMenu in a user control. For example:
| ASCX |
Copy Code |
|
<%@ OutputCache Duration="60" VaryByParam="None" %> <rad:RadMenu ID="RadMenu1" Skin="Outlook" runat="server"> <Items> <rad:RadMenuItem runat="server" Text="Root RadMenuItem"> <Items> <rad:RadMenuItem runat="server" Text="Child RadMenuItem"> </rad:RadMenuItem> <rad:RadMenuItem runat="server" Text="Child RadMenuItem"> </rad:RadMenuItem> </Items> </rad:RadMenuItem> <rad:RadMenuItem runat="server" Text="Root RadMenuItem"> </rad:RadMenuItem> </Items> </rad:RadMenu> |
However, if the aspx page that contains this user control does a postback, the menu will loose its styles and appear as a bullet list of hyperlinks:
The reason for this is that when the aspx page postbacks, it receives the cached output which doesn't contain the path for the css styles of the menu.
To fix the problem, you need to manually register the menu styles in the aspx:
| |
Copy Code |
|
<head runat="server"> <link type="text/css" href="RadControls/Menu/Scripts/4_1_3/menu.css" rel="stylesheet" /> <link type="text/css" href="RadControls/Menu/Skins/Outlook/styles.css" rel="stylesheet" /> </head> |
A menu with Outlook skin will use the following css files:

See Also