gridview 显示超链接数据,字体颜色和下划线怎么改

方法一、在页面写样式 <style type="text/css">
table a
{text-decoration:none}
</style>

注:gridview在浏览器编译成table、

方法二、首先将hyperlinkfield转换为模板列,然后在gridview中的行绑定事件(RowDataBind)中写代码、

if (e.Row.RowType == DataControlRowType.DataRow)
{
HyperLink h = e.Row.FindControl("HyperLink1") as HyperLink;
h.Attributes.Add("style", "text-decoration:none;");
}

原文地址:https://www.cnblogs.com/proving/p/11014612.html