C# 基于URL属性定义所选菜单选项
我在razor View MVC中有一个菜单:C# 基于URL属性定义所选菜单选项,c#,css,asp.net-mvc,razor,C#,Css,Asp.net Mvc,Razor,我在razor View MVC中有一个菜单: @Html.ActionLink("Criar Nova", "Create", new { tipo = Request.Params["tipo"] }) @Html.ActionLink("Listar Todas", "Index", new { tipo = @ViewBag.ENTIDADE_LISTAR_TODAS }) @Html.ActionLink("Listar Expedidoras", "Index", new { tip
@Html.ActionLink("Criar Nova", "Create", new { tipo = Request.Params["tipo"] })
@Html.ActionLink("Listar Todas", "Index", new { tipo = @ViewBag.ENTIDADE_LISTAR_TODAS })
@Html.ActionLink("Listar Expedidoras", "Index", new { tipo = @ViewBag.ENTIDADE_LISTAR_TIPO_EXP })
@Html.ActionLink("Listar Destinatárias", "Index", new { tipo = @ViewBag.ENTIDADE_LISTAR_TIPO_DEST })
视图的URL类似于www.xxx.com?tipo=YYY
如何在基于YYY值的ActionLink文本中设置粗体样式
谢谢。假设您知道如何剥离url并获取字符串变量,您可以在html链接本身中使用粗体来分配css类
<head>
<style>
.activeMenu{font-wieght:bold;}
</style>
</head>
@Html.ActionLink("Criar Nova", "Create", new { tipo = Request.Params["tipo"] }, new { @class = "activeMenu"})
.activeMenu{font-wieght:bold;}
@ActionLink(“Criar Nova”,“Create”,new{tipo=Request.Params[“tipo”]},new{@class=“activeMenu”})
您好,谢谢,但是我如何才能将.Params值设置为插入类属性的正确选项?