ASP.NET MVC - Changing Culture
Posted on 2010-08-24
I'm trying to change the displayed language in my MVC application by routing the ActionLink on my Masterpage to an action on a controller. However, I would like that the page I'm on refreshed itself with the changed culture.
Now I'm hardcoding to have a RedirectToAction back to the Index action of another controller.
Is is possible to return to the same page?
Here is my code:
public class CultureController : Controller
public ActionResult ChangeLanguage(string culture)
HttpCookie cookie = new HttpCookie("StockManagementCookie");
cookie.Values["culture"] = culture;
cookie.Expires = DateTime.Now.AddYears(1);
return RedirectToAction("Index", "Reservation");