Static menus should always be stored in an xml file instead of a databases. This will increase performance and will save trips to the database. Here is a nice way to access the contents of the xml file which contains the "Name" and the "Url" of the menu items. I have also used
Caching so I only have to access the file when its contents are changed.
private const string MENU = "Menu";
private const string MENU_FILE = "Menu.xml";
private DataSet BuildMenu()
{
DataSet dsMenu = new DataSet();
if(Cache[MENU] != null)
{
dsMenu = (DataSet) Cache[MENU];
}
else
{
dsMenu.ReadXml(Server.MapPath(MENU_FILE));
Cache.Insert(MENU,dsMenu,new System.Web.Caching.CacheDependency(Server.MapPath(MENU_FILE)));
}
return dsMenu;
}