The menu control and sitemap file in ASP.NET 2.0 provide a very simple implementation method for website navigation, but there is an annoying thing that cannot control the window that the menu opens. It is more difficult to deal with the menu that often needs to pop up a new window. . There is actually a very simple method.
First, add your own defined attributes to the sitemap file. Here we use target <siteMapNode title="Home" description="" target="_blank" url="~/Default.aspx" /> and then add the MenuItemDataBound event handling codeprotected
for the Menu control.
void MyMenu_MenuItemDataBound(object sender, MenuEventArgs e)
{
string target = ((SiteMapNode)e.Item.DataItem)["target"];
if (target != null && target.Length > 0) e.Item.Target = target;
}