使部分文本变为粗体 [英] make some portion of text to be bold
本文介绍了使部分文本变为粗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我对mvc更有兴趣。我在mvc视图中有一个标签。在控制器中我已将文本分配给标签,如TempData [lblmsg] =名称:abc pqr。
我想要姓名这个词应该是粗体和其他的话应该是正常的。这有可能在mvc ????
谢谢...
Hi
I am begginer to mvc.I have one label in mvc view.In controller i have assign text to label like TempData["lblmsg"]="Name:abc pqr".
I want to "Name" word should be bold & other words should be normal.Is it possible in mvc????
Thanks...
推荐答案
包含名称为< b>名称< / b>在tempdata。
Include Name as <b>Name</b> in tempdata.
只是将它们分开:)
希望这会有所帮助,
Elieser Legaspi
just separate them :)
Hope this helps,
Elieser Legaspi
在控制器中
In the controller
public ActionResult Index()
{
ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
TempData["LableText"] = "<b>Code</b> Project";
return View();
}
在视图中
In the view
@Html.Raw(TempData["LableText"].ToString())
希望这有助于
Hope this helps
这篇关于使部分文本变为粗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文