单击@ Html.ActionLink两次以上时,位置URL上发生了什么?

时间:2015-03-17 03:21:45

标签: asp.net-mvc angularjs asp.net-mvc-4 ngroute

根据:

Route to different View(use @Html.ActionLink and ng-view in View) in Asp.Net MVC with AngularJS, ng-view only work one time, location url strange

<ul>
    <li>@Html.ActionLink("Home", "Index", "Home")</li>
    <li>@Html.ActionLink("Device Management", "Index", "DeviceManagement")</li>
</ul>

如果我第一次点击设备管理,则位置为:(使用ngRoute到&#34; / device&#34;成功!)

http://localhost:13060/DeviceManagement#/device

如果我再次单击“设备管理”,则位置为:(使用ngRoute至&#34; / device&#34;无法正常工作!)

http://localhost:13060/DeviceManagement#

为什么&#34; / device&#34;当我单击上面的@ Html.ActionLink两次时会消失吗?

@ Html.ActionLink发生了什么?

1 个答案:

答案 0 :(得分:0)

在这种情况下,它应该在客户端以角度路由进行路由。应该修改动作链接:

<a href="/#/home">Home</a>
<a href="/#/devicemanagement">Device Management</a>
相关问题