Szerkesztés

Megosztás a következőn keresztül:


Menu.RenderingMode Property

Definition

Gets or sets a value that specifies whether the Menu control renders HTML table elements and inline styles, or listitem elements and cascading style sheet (CSS) styles.

public:
 property System::Web::UI::WebControls::MenuRenderingMode RenderingMode { System::Web::UI::WebControls::MenuRenderingMode get(); void set(System::Web::UI::WebControls::MenuRenderingMode value); };
public System.Web.UI.WebControls.MenuRenderingMode RenderingMode { get; set; }
member this.RenderingMode : System.Web.UI.WebControls.MenuRenderingMode with get, set
Public Property RenderingMode As MenuRenderingMode

Property Value

A value that specifies whether the Menu control renders HTML table elements and inline styles, or listitem elements and cascading style sheet (CSS) styles. The default value is Default.

Remarks

The value of the RenderingMode property determines how the menu control renders markup for the Menu control.

In ASP.NET 3.5 and earlier versions, the Menu control uses HTML table elements and inline styles to specify the appearance of the menu in a browser. In ASP.NET 4 and later versions, by default the Menu control uses HTML listitem elements and cascading style sheet (CSS) styles.

If you do not set this property, the Menu control renders markup that is appropriate to the ASP.NET version that is indicated by the Control.RenderingCompatibility property. The Menu control uses the following rules:

This property is provided for backward compatibility. If the RenderingCompatibility property indicates that you want controls to generate HTML that is compatible with ASP.NET 4 or later, but you want the Menu control to be an exception that uses earlier behavior, you can set this property to Table. For example, if you have a Web page that displays text from right to left you might want to set this property to Table because some browsers do not display the List mode markup properly for right-to-left text.

Applies to

See also