Closed JobaDiniz closed 7 years ago
So if I understand you correctly, you want to generate a neutral (non-localized) route?
Neutral route only exists by default if you use AddAsNeutralRoute
, AddAsNeutralAndDefaultCultureRoute
or AddAsNeutralRouteAndReplaceByFirstTranslation
for AttributeRouteProcessing
.
If there is no neutral route, you can add it manually via AddNeutralTranslation
.
localization.AddNeutralTranslationForNamedRoute("PaypalRedirect");
Does this help / work for you?
You may also post your RouteLocalization setup.
localization.AddNeutralTranslationForNamedRoute("PaypalRedirect");
it worked.
It seems that is not possible to have routes without localization once you add a localization for any route. (using attribute routing)
My controller without setting up localization for it.
In my WebApi, I'm trying to build a link to that action:
var url = Url.Link("PaypalRedirect", null);
However, url is alway null.But, once I add a localization for that route, and write
var url = Url.Link("PaypalRedirect", new {culture = "en-US"});
it works, the generated url is right.How I can fix this?