Reduce ASP.NET menu control size (without 3rd party libraries)
Question
I have a fairly simple ASP.NET 2.0 menu control using a sitemap file and security trimmings. There are only 21 menu options, but the results HTML of the menu is a whopping 14k. The site is hosted on our company's intranet and must be serverd to people worldwide on limited bandwidth, so I'd like to reduce the size of the menus.
What is the best way to do this? Does anybody have a good reference? I have the following constraints:
- The solution must not reference any 3rd part DLL files (getting approval would be a nightmare)
- Has to work with IE 6
CSS and JavaScript are fine, as long as they work with IE 6.
Solution
Take a look at: http://www.asp.net/CSSAdapters/Menu.aspx
The default Menu control is rendering far too much HTML.
OTHER TIPS
You might have a look at my ASP.NET menu optimization post. What I do is extracting the common part of the menu rendered in every page to an external file that is loaded and cached only once at the user browser. This way the pages are 60-70% smaller in some cases.