asp.net mvc - How to translate query paramters using Attribute Routing in MVC website? -
i have horsecontroller index method like:
[get("index", translationkey = "horseindex")] [allowanonymous] public actionresult index(int? page, horsetypes? type, horsegenders? gender, horsebreeds? breed, horsejumps? jump, horsedressages? dressage, string maxage, string pricefrom, string priceto, country? country, bool? haspicture, bool? hasvideo) { ... }
and translate route like:
provider.addtranslations() .forkey("horseindex", new dictionary<string, string> { { "da", "heste-til-salg" }, { "en", "horses-for-sale" } })
the issue now, url danish user is:
http://localhost:12623/heste-til-salg?page=1&haspicture=false&hasvideo=false
my question how translate query parameters too?
i not able find in documentation.
i don't think can. querystring in mvc routes treated generic dumping ground data passed along doesn't fit in url. if it's not generic data don't know @ design time, should part of url. if generic data, there's no way provide translation , extraneous data might show in querystring.
Comments
Post a Comment