简体   繁体   English

T4MVC Url.Action(MVC.Area.Controller.Action())返回null

[英]T4MVC Url.Action(MVC.Area.Controller.Action()) returns null

I'm trying get URL using Url.Action() and T4MVC. 我正在尝试使用Url.Action()和T4MVC获取URL。 But this method returns null : 但是此方法返回null

Url.Action(result:MVC.Data.Persons.Search())

how can I solve this problem? 我怎么解决这个问题?

I'm not sure why it's happening but this was my Area's default route: 我不确定为什么会发生这种情况,但这是我地区的默认路线:

context.MapRoute(
    "Data_default",
    "Data/{controller}/{action}/{id}",
   MVC.Data.Persons.Persons()
);

and that also made Data area inaccessible so I rolled back to non-T4MVC mode and both problems solved! 而且这也使Data区域无法访问,所以我又回到了非T4MVC模式,两个问题都解决了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.NET MVC 5 属性路由:Url.Action 返回 null - ASP.NET MVC 5 Attribute Routing: Url.Action returns null ASP.NET MVC 5属性路由:使用多个参数时,Url.Action返回null - ASP.NET MVC 5 Attribute Routing: Url.Action returns null when using multiple parameters ASP.Net MVC @ Url.Action()路由到错误的控制器 - ASP.Net MVC @Url.Action() routing to the wrong controller 在Asp.net MVC 4中指定area属性时,ActionLink和Url.Action将定位不同的位置 - ActionLink and Url.Action target different locations when area attribute is specified in Asp.net MVC 4 在Asp.Net MVC动态视图的jQuery模板中使用URL.Action时将数据传递给控制器 - Passing data to controller while Using URL.Action in jQuery template in Asp.Net MVC dynamic views 无法在MVC中使用@ Url.Action生成绝对URL - Not able to produce Absolute url with @Url.Action in MVC ASP.NET MVC。 不知道如何使用Url.action将对象传递给控制器 - ASP.NET MVC. No idea how to use Url.action to pass an object to the controller Asp.net MVC Url.Action使用可空参数重定向控制器 - Asp.net mvc Url.Action to redirect controller with nullable parameters 将动态值传递给ASP.NET MVC 5中的Url.Action - pass dynamic value to Url.Action in ASP.NET MVC 5 在JS-asp.net MVC中使用@ Url.Action - Using @Url.Action in JS-asp.net MVC
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM