2015-12-22 214 views
0

我試圖在下面的代碼中使(2)紅色和粗體,但它只是顯示標記。我嘗試了Html.Raw(),但它返回了無法在ActionLink中使用的IHtmlString。ASP .NET MVC ActionLink

@{String surveyCount = "Survey <b>(2)<b>"; } 
@Html.ActionLink(surveyCount, "Index", "Student")</a></li> 

回答

0
@{ 
string surveyCount = 2; 
} 

<a href="@Html.Action("Index","Student")">Survey <b>@surveyCount</b></a> 

,可就是這樣

0
<a href="@Url.Action("Index", "Student")">Survey <span class="danger">(2)</span></a> 
+0

代碼塊本身並不能提供一個很好的答案。請添加解釋。 –