<p><a class="btn btn-default" href="~/Person">List of Cients »</a></p>
我想與HTML鏈接的行動來代替它,但不改變的視覺風格。
我想要去Index
行動PersonController
:
公共類PersonController:控制器 { 私人PersonContext DB =新PersonContext();
// GET: Person
public ActionResult Index()
{
return View(db.Persons.ToList());
}
}
@Html.ActionLink(...)
應該是什麼樣子。
編輯:
我想:
<p><a class="btn btn-default" href="~/Person">List of Cients »</a></p>
@Html.ActionLink("List of Clients »", "Index", "Person", new { @class = "btn btn-default" })
還有就是問題:»
ActionLink的不渲染preetty箭頭。
EDIT2:
沒有結果嘗試這樣:@Html.ActionLink("List of Clients " + HttpUtility.HtmlDecode("»"), "Index", "Person", new { @class = "btn btn-default" })
編輯: 兩個不工作。
<p> @Html.ActionLink("List of Clients »", "Index", "Person", new { @class = "btn btn-default" })</p>
<p> @(Html.ActionLink("List of Clients »", "PersonController/Index", new { @class = "btn btn-default" }));
首先給出正確的風格,但當我點擊我在鏈接中得到length=6
。 二沒有風格和鏈接:http://localhost:17697/Home/PersonController/Index?class=btn%20btn-default
答:這一件作品:
<p> @Html.ActionLink("List of Clients »", "Index", "Person", null, new { @class = "btn btn-default" })</p>
»是不理解的ActionLink的 這筆交易,有preetty''>>在一部開拓創新的鏈接: '
List of Cients »
'||| '@ Html.ActionLink(「客戶名單&raquo」,「索引」,「人員」,新{@class =「btn btn-default」})' –那麼這項工作呢?..我現在明白你的問題了。 ..你應該在問題中提及它。你在問題 – Ani
中問了課,他們不工作。請看OP中的最後一個編輯。 –