MenuRenderingMode 枚举

定义

指定 Menu 控件是呈现 HTML table 元素和内联样式,还是呈现 listitem 元素和级联样式表 (CSS) 样式。Specifies whether the Menu control renders HTML table elements and inline styles, or listitem elements and cascading style sheet (CSS) styles.

public enum class MenuRenderingMode
public enum MenuRenderingMode
type MenuRenderingMode = 
Public Enum MenuRenderingMode
继承
MenuRenderingMode

字段

Default 0

Menu 控件采用默认情况下它为控件的 RenderingCompatibility 属性所指示的 ASP.NET 版本采用的方式呈现标记。The Menu control renders markup in the way it does by default for the version of ASP.NET indicated by the RenderingCompatibility property of the control. 如果 RenderingCompatibility 属性的值为 3.5,则此设置相当于 TableIf the value of the RenderingCompatibility property is 3.5, this setting is equivalent to Table. 如果 RenderingCompatibility 属性的值为 4.0 或更大,则此设置相当于 ListIf the value of the RenderingCompatibility property is 4.0 or greater, this setting is equivalent to List.

List 2

Menu 控件通过使用列表项 (li) 元素和 CSS 样式呈现标记。The Menu control renders markup by using list item (li) elements and CSS styles.

Table 1

Menu 控件通过使用 table 元素和内联样式呈现标记。The Menu control renders markup by using table elements and inline styles.

注解

在设置Menu控件MenuRenderingModeRenderingMode属性时, 可以使用枚举。You use the MenuRenderingMode enumeration when you set the RenderingMode property of the Menu control. RenderingMode属性分配的值确定Menu控件如何呈现标记。The value that you assign to the RenderingMode property determines how the Menu control renders markup.

在 ASP.NET 3.5 及更低版本中Menu , 控件使用table HTML 元素和内联样式控制浏览器中菜单的外观。In ASP.NET 3.5 and earlier versions, the Menu control uses HTML table elements and inline styles to control the appearance of the menu in a browser. 在 ASP.NET 4 和更高版本中, 默认Menu情况下listitem , 控件使用元素和级联样式表 (CSS) 样式。In ASP.NET 4 and later versions, by default the Menu control uses listitem elements and cascading style sheet (CSS) styles. 提供此枚举是为了向后兼容。This enumeration is provided for backward compatibility. 在 ASP.NET 4 和更高版本中, 可以使用此枚举来指定希望菜单控件在早期版本的 ASP.NET 中生成标记的方式。In ASP.NET 4 and later versions, you can use this enumeration to specify that you want the menu control to generate markup the way it does in earlier versions of ASP.NET.

适用于

另请参阅