Daniel Fisher (lennybacon.com)

SOA, DATA & THE WEB

Automatic globalization of the Label control

The PreRender event of the Label control allows to attach a method that can translate the value of the Text property. Connected with a resource or a database and used in a custom base class for Page or in a server control it's very easy to localize a website.

override protected void OnInit(EventArgs e)
{
  ctrl.PreRender += new System.EventHandler(Translator.TranslateLabel);
  ...

ASP.NET, C#

« About making mistakes ... Upgrades »

Comments

Write a comment