当Controller位于:
时,如何通过锚标记调用控制器区域 - > Ticket-> TicketController
以下是代码:
<a href="@Url.Action("TicketTemplate", "MyTickets", new {area = string.Empty,controller = "TicketTemplate", page = Model.PageNumber, sort = "DateCreated ", isAsc = isAsc })">
Date Created
<span class="@clsDateCreated" style="text-align: right;"></span>
</a>
以上代码无效.. 我如何调用控制器? 这是路径:
~/Areas/Ticket/Controllers/TicketTemplateController.cs
答案 0 :(得分:1)
你可以这样做,它会起作用,但我不知道是否有更好的解决方案。
<a href="@Url.Action("MyTickets", "Ticket/TicketTemplate", , new {area = string.Empty,controller = "TicketTemplate", page = Model.PageNumber, sort = "DateCreated ", isAsc = isAsc })">
Date Created
<span class="@clsDateCreated" style="text-align: right;"></span>
</a>