Click here to Skip to main content
15,867,835 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Redirect to action method is not working but redirect is working fine

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


don't know what was the reason behind that


My routeconfig is as below :



C#
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
C#
@using (Html.BeginForm("Upload", "fileupload", FormMethod.Post, new { enctype = "multipart/form-data" }))
      {



Just redirecting to error page saying : The RouteData must contain an item named 'path' with a non-empty string value
Posted
Updated 7-Aug-21 6:23am
Comments
AmitGajjar 17-Jul-13 1:36am    
change action="about" in your routeconfig.

 
Share this answer
 
I don't know why it was redirecting to error Page : but in sample application it was working fine
 
Share this answer
 
Comments
Nirav Prabtani 17-Jul-13 2:03am    
dont post it here mention it as comment this is not an answer. please remove it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900