Base COntroller
public class CultureController : Controller
{
public ActionResult SetCulture(string culture)
{
HttpContext.Session["culture"] = culture
return RedirectToAction("Index", "Home");
}
}
Action Link in _Layout.cshtml file which is applicable to all the views
<li><%= Html.ActionLink("French", "SetCulture", new {controller = "Culture", culture = "fr-FR"})%></li>
<li><%= Html.ActionLink("Spanish", "SetCulture", new {controller = "Culture", culture = "es-ES"})%></li>
Its working and changing the culture as expected.
But My issue is, it is redirecting to HOme/Index Page whenever I'm changinhg the Language/Culture.
Suppose I'm on the Registration page and I want to change the Culture, it should not redirect me to Home/Index Page, rather, I would like to stay on the same page. How is that possible?
Thanks you guys in advance.
Please help.