I have page with a link like

www.domain.com/Login.aspx

and I would like to make this url look like

www.domain.com/en/login
www.domain.com/fr/login

depending on the current language.

I made new route like

routes.MapPageRoute(
         "Login",       // Route name
         "{locale}/login",       // Route URL
         "~/Login.aspx"   // Web page to handle route
     );

but how I can give a value to {locale} from C#, depending on the current language.

NavigateUrl='<%# Page.GetRouteUrl("Login", new { locale = Eval("locale").ToString() }) %>'

P.S. I use ASP.NET 4.0 Webforms.

I think u can do that by placing the page with foreign language in a directory named 'en' and the application will just figure it out- its just a suggestion u can try it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.