在asp.net后面的代码中给锚标记加下划线 [英] Underline the anchor tag in code behind asp.net

查看:84
本文介绍了在asp.net后面的代码中给锚标记加下划线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!


我无法在锚标记下划线,但是href可以正常工作,这是我的代码:



Hello to all!


i am not able to underline the anchor tag but href working fine here is my code:



<a  class="anchortext-decoration" id="ancbusinessurl"   runat="server" style="font-style: normal"></a>


ancbusinessurl.HRef =  dt.Rows[0]["BusinessUrl"].ToString();


ancbusinessurl.InnerText =("<u>" + dt.Rows[0]["BusinessUrl"].ToString()+"</u>");



提前thanx



thanx in advance

推荐答案

什么是ancbusinessurl?

使用CSS,例如

What is ancbusinessurl?

Use CSS, such as

a
{
  text-decoration: underline;
}



不要使用



Don''t use


,您也可以尝试以下方法:
you can also try this :
ancbusinessurl.style.Add("text-decoration","underline");


如果要在代码隐藏中设置
If you want to set in codebehind
ancbusinessurl.Style.Value="text-decoration:underline;";


在html


in html

<a id="aid" runat="server" style="text-decoration:underline;">test</a>


这篇关于在asp.net后面的代码中给锚标记加下划线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆