I'm using the built-in SiteMap feature in ASP.NET with a static web.SiteMap XML file. I'm programmatically editing the Site开发者_JS百科Map in some pages. I'd like to undo these edits when the user leaves.
Initially, I tried to undo my changes in the Page Unload event, but that made the changes right after it finished loading everything else in the page so the user didn't even see the initial change. I Googled around and from what I understood, there is no way to access the code behind when the user is leaving the page. If there is actually a way, how?
The other method I thought of would be to have the SiteMap cache clear every time I load a page. How can you tell a page to clear the SiteMap cache and refresh based on the XML file? Also, would this add a lot of overhead if there was say 200-300 pages in the SiteMap?
精彩评论