I'm using MVC to create a web app and I need to perform a redirect operation. By default the home controller has an index action that redirects to area:
public ActionResult Index(int desktopMode = 0)
{
return RedirectToAction("index", "home", new { area = "area" });
}
to access a specific page. Actually I need another action to be performed, that is placed alongside with the area one. I have created another action called ScheduleManager() defined as follow:
public ActionResult ScheduleManager()
{
return RedirectToAction("Index", "SMSManager");
}
That points to another controller, called SMSManagerController. this action can be called with the url /home/scheduleManager and in fact it enters in the action on home controller. The problem is the fact that it never enters inside the Index action of SMSManagerController, like there is a problem in reching this resource. Is a problem of routes? I've tried using this one:
routes.MapRoute(
name: "SMS",
url: "home/scheduleManager/{controller}/{action}",
defaults: new { controller = "SMSManager", action = "Index" },
namespaces: new string[] { "web.Controllers" }
);
but nothing works. Inside the index I have perdormed a simple return Content("") call, so a blank page should be display at the end. Do you have any idea about how to solve?