i work at a MVC application and i want to make url's more friendly. i was trying to do that using routes but at some url's it doesn't work.
i want a url like http ://localhost:55696/fr/Pages/Lists?pageType=PropertiesList&list=Market to become http: //localhost:55696/fr/(market_in_french)
I was trying with
routes.MapRoute(
name: "MarketFr",
url: UrlStrings.ResourceManager.GetString("Market", new CultureInfo(CultureEnum.fr.ToString())),
defaults: new {controller = "Pages", action = "Lists"}
);
but the result is http://localhost:55696/fr/market?pageType=PropertiesList&list=Market
how can I solve this. The Lists method is defined like this:
public ActionResult Lists(string pageType, string list = "", string viewType = "")
i made the changes:
routes.MapRoute(
name: "MarketFr",
url: UrlStrings.ResourceManager.GetString("Market", new CultureInfo(CultureEnum.fr.ToString())),
defaults: new { controller = "Pages", action = "Lists", pageType = "PropertiesList", list = "Market", viewType = "" }
);
now it doesn't work at all, my url is like at the begining: http://localhost:55696/en/Pages/Lists?pageType=PropertiesList&list=Market
if I type in the address bar http://localhost:55696/fr/market it lands me to the right page, but when i click the button linked to the
Url.Action("Lists", "Pages", new { pageType = PageTypesEnum.PropertiesList, list = PropertyListViewMode.Market })
in the address bar the url is http://localhost:55696/en/Pages/Lists?pageType=PropertiesList&list=Market