views:

93

answers:

1

Hi

i am in middle of refactoring old asp.net code (some of it is from frontpage era) and am wanting to move all the references to the "$Resources:resources, ” from aspx pages to Page_Render in code behind file of each page.

Main purpose of this excersie is to support localization, as we have grown to other internaltional regions. There are about 70 odd aspx pages and each page contains 5 to 10) labels, literals etc with most of them don't have ID tag. :)

How should i go about doing this massive task productively and if there are any tools/tips ppl have for me. I have already spent 5 days on it and it is not even half done :(

K

A: 

I believe you can replace your labels like this:

<span>Some Static Content</span>

to ASP.NET code like this:

<%= Localise("SomeStaticContent") %>

And on your page you can add this:

public string Localise(string key) {
    return HttpUtility.HtmlEncode( ResourceManager.GetString(key) ); // or whatever
}

This should be one of the easiest approaches.

Dmytrii Nagirniak