访问我的某个控制器时,ReturnUrl是否形成不正确?

时间:2015-05-14 10:27:48

标签: asp.net-mvc asp.net-mvc-4 asp.net-mvc-5 asp.net-mvc-routing

当我尝试访问此控制器而没有登录到我的门户网站时,我有一个控制器作业,返回的网址没有正确形成它看起来像 http://test-employer.cloudapp.net/accounts?ReturnUrl=%2F

并用于访问其正确形成的任何其他控制器 http://test-employer.cloudapp.net/accounts?ReturnUrl=%2Fusers 以下是我的路由配置

routes.MapRoute(
    name: "JobFeed",
    url: "jobs/{q}/jobfeed.xml",
    defaults: new { controller = "Jobs", action = "Feed", q = UrlParameter.Optional }
);
routes.MapRoute(
    name: "JobPostingFeed",
    url: "postings/{q}/jobfeed.xml",
    defaults: new { controller = "Postings", action = "Feed", q = UrlParameter.Optional }
);
routes.MapRoute(
    name: "Default",
    url: "{controller}/{action}/{id}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);

0 个答案:

没有答案