Can you help me with The resource cannot be found error, for ActionResult Create and View Create
Every other controller/view are working and I cant find out whats wrong with this one.
Here is my RouteConfig:
public static class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.LowercaseUrls = true;
routes.MapRoute("Default", "{controller}/{action}/{id}", new
{
controller = AutoParts.Domain.Settings.IntegrationType == "Try" ? "Search" : "Home",
action = "Index",
id = UrlParameter.Optional
}).RouteHandler = new DashRouteHandler();
}
}
This is DashRouteHandler:
public class DashRouteHandler : MvcRouteHandler
{
protected override IHttpHandler GetHttpHandler(RequestContext requestContext)
{
var routeValues = requestContext.RouteData.Values;
routeValues["action"] = routeValues["action"].UnDash();
routeValues["controller"] = routeValues["controller"].UnDash();
return base.GetHttpHandler(requestContext);
}
}
Here is My Controller:
[HttpPost]
public ActionResult Create(Mapper20170129 mapper)
{
if (ModelState.IsValid)
{
repository.AddArticle(mapper);
return RedirectToAction("Index");
}
else
{
ModelState.AddModelError("", "Error.");
}
return View(mapper);
}
I've got other Controllers with Create ActionResult and Create View but I don't have any problems and getting this not found error
Thank You in advance for help