重定向到操作无效 [英] Redirect to action is not working

查看:91
本文介绍了重定向到操作无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

重定向到操作方法无效但重定向工作正常



Redirect to action method is not working but redirect is working fine

return RedirectToAction("about", "home");
              return Redirect("~/Home/About");





不知道背后的原因是什么





我的路线配置如下:









don't know what was the reason behind that


My routeconfig is as below :



routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
    name: "Default",
    url: "{controller}/{action}/{id}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);





活动这也不起作用



event this is also not working

@using (Html.BeginForm("Upload", "fileupload", FormMethod.Post, new { enctype = "multipart/form-data" }))
      {







只需重定向到错误pa ge say:RouteData必须包含名为'path'的项目,其中包含非空字符串值




Just redirecting to error page saying : The RouteData must contain an item named 'path' with a non-empty string value

推荐答案

MVC4不同的重定向技术(Razor) [ ^ ]


我不知道它为什么会重定向到错误页面:但在示例应用程序中,它工作正常
I don't know why it was redirecting to error Page : but in sample application it was working fine


这篇关于重定向到操作无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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