Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Globalization of HTML controls

How can i implement globalization in html control

like for ex:

for asp.net control i can do

  <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" meta:resourcekey="Button1" />
        <!-- Explicit Localization -->
        <asp:Button ID="Button2" runat="server" onclick="Button1_Click" Text = "<%$ Resources:Sample_aspx, Button1Caption %>"/>

how do i achieve this in a html control like a label or html anchor tag

like image 582
Amit Avatar asked Dec 01 '25 16:12

Amit


1 Answers

You could probably do it a number of ways...The first one would be to add the runat="server" control which turns any regular control into a server control

or perhaps use the localization control. Here's a sample from the MSDN article on localization:

<h1>
   <asp:localize runat="server" 
       Text="<%$ Resources:WebResources, WelcomeMessage %>" />
</h1>

This would grab the value from your resource file and put in in a h1 tag which is just regular html

That link also has some other pretty useful information to your problem...

like image 82
davidsleeps Avatar answered Dec 04 '25 09:12

davidsleeps