locked
Character Encoding Problem in Javascript Alert Box RRS feed

  • Question

  • User-574293449 posted

    hi,

      I implemeted localisation in my page. My aim is to display the message in localised language in javascript alert box. I created 2 langauges other thanEnglish namely Hindi and French. In my page i have one label and one button. Label displayed as 'Message' based on the language and when i click button, show javascript alert box with 'hello' based on the culture.

    My label worked correctly in French and Hindi. But my alert box showed only in French. For Hindi it shown as square, but in label hindi displayed correctly. Can any one help about this problem

     protected void Page_Load(object sender, EventArgs e)
    {
    
        System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("hi-IN");
         System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("hi-IN");
    
          lbl.Text = GetGlobalResourceObject("General", "message").ToString();
          string confirmText = GetGlobalResourceObject("General", "displayValue").ToString();
         Button1.Attributes.Add("onclick", " alert('" + confirmText + "');");
     }
    Tuesday, September 13, 2011 7:25 AM

Answers

  • User377791177 posted

    I'll suggest to use ModelPopupExtender, because it is capable of showing HTML as popup hence any font can be seen.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 13, 2011 8:40 AM

All replies

  • User377791177 posted

    I'll suggest to use ModelPopupExtender, because it is capable of showing HTML as popup hence any font can be seen.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 13, 2011 8:40 AM
  • User-574293449 posted

    Thanks friend for your idea. I am using Telerik controls and i used radalert for this purpose and worked fine

    Wednesday, September 21, 2011 5:58 AM