asp.net - 如何在 ASP .NET 中加粗文本

标签 asp.net

我怎样才能像这样加粗我的输出

学生“John”分配给官员“Mick”。

我希望 JohnMick 在网页上加粗

这是我的 aspx 代码:

this.lblAssignee.Text = " Student \"" + StudentAssign + "\" assigned to Officer \"" + objAssign.FullName + "\".";

最佳答案

试试这个

this.lblAssignee.Text = " Student \"<b>" + StudentAssign + "</b>\" assigned to Officer \"<b>" + objAssign.FullName + "</b>\".";

或者这个(更好的可维护性)

this.lblAssignee.Text = " Student \"<span class='highlight'>" + StudentAssign + "</span>\" assigned to Officer \"<span class='highlight'>" + objAssign.FullName + "</span>\".";

在你的样式表中

.highlight { font-weight: bold; }

关于asp.net - 如何在 ASP .NET 中加粗文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11608968/

相关文章:

c# - ASP.NET 添加迁移在 IdentityModels.cs 更改上生成空迁移

c# - 下载的 dll 中显示错误

jquery提交-在发布之前更改输入值

c# - 如何将 Controller 用于局部 View ?

asp.net - 使用 onkeypress 时 window.location.href 在 Safari 中不起作用

c# - 为什么应用程序无一异常(exception)地默默死去?

c# - log4Net 中记录器和根级别的区别?

c# - Asp.net 中的母版页未加载代码实现

asp.net - 在 ASP.NET MVC 中的两个网站之间共享 session

c# - AngularJs、WebAPI、JWT,带有(集成的)Windows 身份验证