区域在Html.ActionLink()中不起作用 [英] area does not work in Html.ActionLink()

查看:99
本文介绍了区域在Html.ActionLink()中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

context.MapRoute(
               "ImportNightflight_default",
               "ImportNightflight/{controller}/{action}/{id}",
               new { action = "Index", id = UrlParameter.Optional }
           );







@ Html.ActionLink (Nightflight - 导入的文件历史记录,List,新的{controller =ImportedDocs,area =ImportNightflight})



这个返回onlu href。

例如: Nightflight - 上传和导入行



尽快给我解决方案




@Html.ActionLink("Nightflight - Imported files history", "List", new { controller = "ImportedDocs", area = "ImportNightflight" })

this returnd onlu href.
example :Nightflight - Upload and import rows

give me the solutions as soon as possible

推荐答案

如果您的控制器和区域名称相同,则需要添加名称空间。



如需更多帮助VISTI:<无线电通信/>
ASP.NET MVC 4中的区域 [ ^ ]
You need to add namespaces if your controller and areas name is same.

For more help visti:
Areas in ASP.NET MVC 4[^]


这篇关于区域在Html.ActionLink()中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆