I have an issue and cant seem to resolve it. I have a url, thats like:
myurl/?culture=fr
what I want is
myurl/fr
My Controller looks like :
public ActionResult Index(string culture = null)
and my routeConfig:
routes.MapRoute(
name: "Languages",
url: "{controller}/{action}/{culture}"
);
This results in the page isn't redirecting properly. Any hints to solve it?
Give default Controller and action in your route if you are appending "fr" to the root of the URL(www.yourUrl.com/fr). like this :-
routes.MapRoute(
name: "Languages",
url: "{controller}/{action}/{culture}",
defaults: new { controller = "Home", action = "Index"}
);
Replace "Home" with your default controller and "Index" with default action.