1
後,我是一個網頁設計師,但我告訴設計在MVC靜態網頁,而不是使用HREF =「某些URL」通過部分ID在MVC我必須使用href =「@ Url.Action(」Controller「,View)」現在我想在URL中傳遞一個部分id,所以當用戶重定向它時,它會通過html滾動到特定部分,這是語法我在HTML中使用使用@ Url.Action讓用戶將滾動到一個特定部分重定向
href="index.html#mysectionid"
我有這樣的事情
<section id="mysection">
</section>
我想知道如何我會在mvc中做這件事。由於
你必須自己拼接吧。類似於' – haim770
您可以使用[this overload](https://msdn.microsoft.com/ EN-US /庫/ system.web.mvc.html.linkextensions.actionlink(v = vs.118)的.aspx#L:System.Web.Mvc.Html.LinkExtensions.ActionLink%28System.Web.Mvc.HtmlHelper,系統的.String,System.String,System.String,System.String,System.String,System.String,System.Object的,System.Object的29%)'@ Html.ActionLink()',並指定'fragment' –