Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在MVC中将href与Html.ActionLink合并到节中?_Html_Asp.net Mvc - Fatal编程技术网

如何在MVC中将href与Html.ActionLink合并到节中?

如何在MVC中将href与Html.ActionLink合并到节中?,html,asp.net-mvc,Html,Asp.net Mvc,我是MVC新手,遇到了一个问题。我有一个HTML页面,当从导航栏单击某个节的名称时,该页面会向下滚动到该节,但现在我必须将此HTML代码行更改为MVC: <li><a class="page-scroll" href="#services">Services</a></li> 试一试 创建自己的帮助程序或使用原始html 或 在您的索引页上: 以下是单击链接时要显示的内容 当您单击“链接文本”时,它将引导您进入索引页的“服务”部分 可能是

我是MVC新手,遇到了一个问题。我有一个HTML页面,当从导航栏单击某个节的名称时,该页面会向下滚动到该节,但现在我必须将此HTML代码行更改为MVC:

<li><a class="page-scroll" href="#services">Services</a></li>
试一试


创建自己的帮助程序或使用原始html

  • 在您的索引页上:

    
    以下是单击链接时要显示的内容


    当您单击“链接文本”时,它将引导您进入索引页的“服务”部分

    可能是重复的,谢谢你!
    @Html.ActionLink("Services", "Index", "Home", new { area = "#services" }, new { @class = "page-scroll" })
    
    @Html.ActionLink("Services", "Index", "Home#services", new { @class = "page-scroll" })