views:

16

answers:

2

I would like to provide localization for my website in Azure. I went with a classic aspx website since localization is supported by classic asp out-of-the-box and I have only a few pages. I want to keep it simple so MVC might be overkill.

I plan to register only 1 Azure web role for the site (foo.com) but would like virtual paths for localization, eg. foo.com/de-de, etc. Azure does not allow virtual folders like IIS, so I think I can use Request.Path and do some jugglery to detect the virtual (localized) path.

Can you think of any other clean method? Maybe some web.config tags?

Thanks

A: 

Maybe you can do something with ASP.NET routing?

maartenba
A: 

yes, sorry I did not see your response earlier and that's exactly what I used. I was not aware that we can use routing in web forms: http://msdn.microsoft.com/en-us/library/cc668177.aspx

I defined my localization pattern in the RegisterRoutes, like:
routes.MapPageRoute("loc", "{language}-{country}/{action}", "~/default.aspx", true)

Rather than page load, I use the InitializeCulture() event and set the thread culture based on the values as derived from the route spec., e.g. string lang = Page.RouteData.Values["lang"].ToString(); Remember to check for nulls, etc. Think of putting this in a base Page class of yours.

Ra