2010-11-25 56 views
0

我有一個雙列布局,在左側窄列中有一個垂直方向的ASP.NET菜單控件,以及與右列中所選菜單項有關的信息:防止ASP.NET菜單擴展到相鄰的內容

<div class="span-4"> 
    <asp:Menu ID="categoryMenu" runat="server" Orientation="Vertical"> 
    </asp:Menu> 
</div> 
<div id="product-grid-pane" class="span-12 last"> 
    <asp:GridView ID="productGrid" runat="server" AutoGenerateColumns="false" ShowHeader="false" Width="100%"> 
    </asp:GridView> 
</div> 

如果菜單項包含長文本,菜單只是在網格上擴展。我怎樣才能防止這一點?我可能在這裏需要兩個答案:純粹的CSS,如果菜單控制很好,簡單的UL元素,這將是非常好的,但它似乎更喜歡不可穿透的基於表格的結構,我可能需要額外的幫助樣式正確。

回答

1

如果您使用的是ASP.net 4.0,則Menu控件有一個名爲RenderingMode的屬性,您可以將其設置爲TableList

否則,您可以給表width:100%table-layout:fixed和您的包含div overflow:hidden