public override void RenderBeginTag(HtmlTextWriter writer, bool staticOnly)
{
ControlRenderingHelper.WriteSkipLinkStart(writer, Menu.RenderingCompatibility, Menu.DesignMode, Menu.SkipLinkText, Menu.SpacerImageUrl, Menu.ClientID);
// <table cellpadding="0" cellspacing="0" border="0" height="nodespacing">
// Determine root menu style
// First initialize the root menu style that depends on the control style before we change it. (VSWhidbey 354878)
Menu.EnsureRootMenuStyle();
if (Menu.Font != null)
{
// Relative sizes should not be multiplied (VSWhidbey 457610)
Menu.Font.Reset();
}
Menu.ForeColor = Color.Empty;
SubMenuStyle rootMenuStyle = Menu.GetSubMenuStyle(Menu.RootItem);
if (Menu.Page != null && Menu.Page.SupportsStyleSheets)
{
string styleClass = Menu.GetSubMenuCssClassName(Menu.RootItem);
if (styleClass.Length > 0)
{
if (Menu.CssClass.Length == 0)
{
Menu.CssClass = styleClass;
}
else
{
Menu.CssClass += ' ' + styleClass;
}
}
}
else
{
if (rootMenuStyle != null && !rootMenuStyle.IsEmpty)
{
// Remove FontInfo and ForeColor from the submenustyle where they are not relevant
// but may get copied from by ControlStyle (VSWhidbey 438980)
rootMenuStyle.Font.Reset();
rootMenuStyle.ForeColor = Color.Empty;
// It's ok to change the control style at this point because viewstate has already been saved
Menu.ControlStyle.CopyFrom(rootMenuStyle);
}
}
Menu.AddAttributesToRender(writer);
writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "0");
writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
writer.RenderBeginTag(HtmlTextWriterTag.Table);
}