Refactoring a large old ASP.Net solution
I'm in the middle of refactoring old asp.net code (some of it date back to the first page era) and I want to move all references to "$ Resources: Resources" from aspx pages to Page_Render in code by file every page.
The main purpose of this exterior is to maintain localization as we have grown into other international regions. There are about 70 odd aspx pages, and each page contains 5 to 10) labels, literals, etc., with most of them not having an ID tag. :)
How should I do this huge task productively and if there are any tools / tips I have for me. I've already spent 5 days on this and it's not even halfway done :(
TO
I believe you can replace your labels like this:
<span>Some Static Content</span>
for ASP.NET code:
<%= Localise("SomeStaticContent") %>
And in 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 simplest approaches.
a source to share