日期:2014-05-18  浏览次数:20372 次

是不是vs2005的BUG,各位帮忙呀
我在使用Menu控件时,我想做到一个效果就是:
当选中某一个菜单项时,选中的菜单项字体为粗体,并且下划线消失(原本有下划线),为此我设置了StaticSelectedStyle属性,问题是现在选中后字体变粗了,但下划线依然存在,不知道为啥Font-Underline= "False "不起作用?

具体源码:
<%@   Page   Language= "C# "   AutoEventWireup= "true "     CodeFile= "Default.aspx.cs "   Inherits= "_Default "   %>

<!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

<html   xmlns= "http://www.w3.org/1999/xhtml "   >
<head   runat= "server ">
        <title> 无标题页 </title>
</head>
<body>
        <form   id= "form1 "   runat= "server ">
        <div>
                <asp:Menu   ID= "Menu1 "   runat= "server "   Orientation= "Horizontal "   Width= "206px ">
                        <StaticMenuItemStyle   Font-Underline= "True "   />
                        <StaticSelectedStyle   Font-Bold= "True "   Font-Underline= "False "   ForeColor= "Black "   />
                        <Items>
                                <asp:MenuItem   Text= "test1 "   Value= "test1 "> </asp:MenuItem>
                                <asp:MenuItem   Text= "test2 "   Value= "test2 "> </asp:MenuItem>
                                <asp:MenuItem   Text= "test3 "   Value= "test3 "> </asp:MenuItem>
                        </Items>
                </asp:Menu>
       
        </div>
        </form>
</body>
</html>


------解决方案--------------------
设置下超链接样式不知道行不行
------解决方案--------------------
估计是bug,因为选中过的Item也包含了StaticMenuItemStyle的样式,所有还有underline
------解决方案--------------------
估计是Bug,我这个打了SP1的还有下划线 CSS高手来
------解决方案--------------------
學習ing
------解决方案--------------------
lz太有才了
------解决方案--------------------
只能用css了,放到head里面还不行 很奇怪

<body>
<style type= "text/css ">
.notunderline { text-decoration:none; }
</style>
<form id= "form1 " runat= "server ">
<div>
<asp:Menu ID= "Menu1 " runat= "server " Orientation= "Horizontal " Width= "206px ">