简体   繁体   English

如何强制Asp.net 3.5菜单控件呈现为UL列表项

[英]How to force Asp.net 3.5 Menu Control to Rendered as UL List Item

As you all know Asp.net 3.5 and past generations Rendered as Table ( TR - TD ) form and this makes it heavy to load and blah blah blah. 众所周知,Asp.net 3.5和过去的几代渲染为表格(TR - TD)形式,这使得它很难加载,等等等等等等。 Microsoft change the rendering methods of this control from table to UL LI in Asp.net 4.0 Microsoft在Asp.net 4.0中将此控件的呈现方法从表更改为UL LI

As I am using Asp.net 3.5 , Is there any solution to force this control rendered as a UL LI ? 当我使用Asp.net 3.5时,是否有任何解决办法强制将此控件呈现为UL LI?

Simply Change Rendering Mode :) 只需更改渲染模式:)

<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" CssClass="menu" 
                        RenderingMode="List" >

The CSS friendly control adapters for ASP.NET 2.0 are doing precisely that. 用于ASP.NET 2.0CSS友好控件适配器就是这样做的。 I've used them a couple of times and they always did the job. 我已经使用了他们几次,他们总是做这个工作。 They can be activated/deactivated for each control type. 可以为每种控制类型激活/停用它们。 For the grid control for example they render the tag, which as we all know is essential for easy styling. 例如,对于网格控件,它们渲染标签,众所周知,标签对于简单的样式是必不可少的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM