0

I have a next routes settings:

routes.MapRoute(
                    name: "TestCC",
                    url: "TestCC/{action}",
                    defaults: new { controller = "PaymentHub", action = "Cancelled" }
                    );

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

When user is open TestCC action I try to redirect them to other action that should conteine {culture}

public ActionResult TestAction()
        {
            TempData["pp"] = Request["p1"];
            TempData["dd"] = Request["p2"] ;
            return RedirectToAction("OtherAction", "OtherController");
        }

How to add {culture} part to redirect in RedirectToAction? I don't want to write culture="value" to Default route.

Petr Abdulin
  • 33,883
  • 9
  • 62
  • 96
Arbejdsglæde
  • 13,670
  • 26
  • 78
  • 144

1 Answers1

1

Not sure if I understand you correctly, but I guess this will do what you want:

RedirectToAction("OtherAction", "OtherController", new {culture = "value"});

Petr Abdulin
  • 33,883
  • 9
  • 62
  • 96