Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How to fill site menu via Cache?

Posted on 2011-02-17
Medium Priority
Last Modified: 2013-12-17
i try to fill my menu with company stuff roles. Filling site map needs to many time.(4000ms) however; i filled site menu only one time in loading menu. like that:
NOT necessary to fill menu via cache . you can give me another advise to do it:)
    protected void Page_Load(object sender, EventArgs e)

            if (!IsPostBack)
                if (Session["IsPostBack"] == null)

                    SiteMapProvider sitemapProvider = (SiteMapProvider)Cache.Get("menu");
                    ASPxSiteMapDataSource1.Provider = sitemapProvider;
                    ASPxMenuMain.DataSource = ASPxSiteMapDataSource1;
  protected void FillMenu()
                SiteMapProvider sitemapProvider = GetSiteMapProvider(tempx);
                ASPxSiteMapDataSource1.Provider = sitemapProvider;
                ASPxMenuMain.DataSource = ASPxSiteMapDataSource1;
                Session["IsPostBack"] = "Postback";

    protected void FillFromCache(SiteMapProvider _provider)
            if (Cache["menu"] == null)
                Cache.Insert("menu", _provider);

Open in new window

Everything is ok on my local pc. After publishing my asp.net project, i see that our portal's menu don't show correct menu element.How can i solve it?
Question by:programmerist
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 18

Accepted Solution

Richard Lee earned 2000 total points
ID: 34941769
Put the menu in a usercontrol and use outputcache to have the menu either cached by IIS server side or cache by the client and along the route.



Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question