0

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?

Marcus
  • 81
  • 9
  • Does [this](https://stackoverflow.com/questions/1391887/redirecttoaction-between-areas) answer your question? – mason Jun 05 '19 at 13:56
  • Even by setting area="" as stated in the possible solution nothing works, the action is entered, but in SMSManager nothig happen and the Index is never called – Marcus Jun 05 '19 at 14:04
  • Can you show your SMSManager controller – adolja Jun 06 '19 at 09:40

0 Answers0