Click here to Skip to main content
15,895,256 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..
Im using TextBoxWatermarkExtender for my application. I need to show watermark text from global resource files. Guide to solve this...
Posted

1 solution

Is this what you are looking for
Page Code Behind:
using System.Threading;
using System.Globalization;
using System.Resources;

ResourceManager rm;
protected void Page_Load(object sender, EventArgs e)
   {

      initResourceManager();
      TextBoxWatermarkExtender.WatermarkText=  rm.GetString("ResourceName");

  }
private void initResourceManager()
  {
     Thread.CurrentThread.CurrentCulture = new CultureInfo(Session["Language"].ToString());// provided you have a Session["Language"] with Language value like "en-EN" or "de-DE"
     Thread.CurrentThread.CurrentUICulture =                                                                                             Thread.CurrentThread.CurrentCulture;
     rm = (ResourceManager)Application["RM"];
  }

Global.asax
C#
using System.Threading;
using System.Globalization;
protected void Application_Start(object sender, EventArgs e)
 {

    Thread.CurrentThread.CurrentCulture = new CultureInfo("en-EN");
    Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
    Application["RM"] = Resources.ResLanguage.ResourceManager;

 }


Hope it Helps.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900