无法删除链接按钮的下划线

Can't remove underline of linkbutton

在我的网络表单中,我有一个 link 按钮定义为....

<asp:LinkButton Visible="True" style="text-decoration:none;color:blue;" Font-Underline="false" runat="server" ID="lnkEditCarOrderNumber" 
    CommandName="EditCarDetails"><%#((int)Eval("CarStatusId")!=1 && (Eval("CarOrderNumber")=="" || Eval("CarOrderNumber")==DBNull.Value)) 
    ? "(click to add)" 
    Eval("CarOrderNumber")%>
</asp:LinkButton>

文本是动态的,由 C# 三元表达式创建。

如您所见,我尝试删除样式和字体下划线中的下划线。但是 link 总是显示下划线。知道为什么吗?

我知道我可以尝试 CSS,但使用内联样式也应该有效。任何见解将不胜感激。

尝试使用以下代码:

text-decoration: none !important;

关于“!important”的更多信息: https://css-tricks.com/when-using-important-is-the-right-choice/

我会删除

Font-Underline="false"

并使用

CssClass="nounderlineline" //use your own css class or create one.

这适用于我的网站,我经常使用 LinkBut​​tons。应该也适合你。