How to Use the Localize Control in Visual Basic.NET
This tutorial will show how to use the Localize control to display static text in Visual Basic.NET. The Localize Control lets you localize any element on an .aspx page. It provides a design time attribute not offered by its base class, the Literal control. Specifically, the Localize control provides design time editing of static content so you can see a default value while working in page design mode.
Setting Up
If you have not done so already, create an empty web site. To do so, open Visual Studio and click File > New > Web Site. Using ‘Visual Basic’ as the template, select ASP.NET Empty Web Site, name the web site LocalizeControl-VB and click OK. Now right click the web site name in solution explorer and click Add New Item. Using ‘Visual Basic’ as the template, select Web Form, leave the form name as Default.aspx and click add.
Step One
In the source view of Default.aspx, place a Localize and Button control in the open div tags. Add “Localize Text” to the Text of the Localize control and change the Text of the Button control to “Change Localize Text”.
Switch to design view and double click the “Change Localize Text” Button control to generate a click event in the code behind. Every time the button is clicked, the code inside the Button1_Click event method will execute. This event will use the Localize control to display static text by changing the Text value.
Save and run the web site. You should see a simple “Localize Text” and Button control on the page. When you click the button, the text will change to “Localize Text Changed!”, thus changing and displaying static text.

Thanks for reading and make sure to download the source files to get a better understanding of how the code works.
LocalizeControl-VB.zip
Setting Up
If you have not done so already, create an empty web site. To do so, open Visual Studio and click File > New > Web Site. Using ‘Visual Basic’ as the template, select ASP.NET Empty Web Site, name the web site LocalizeControl-VB and click OK. Now right click the web site name in solution explorer and click Add New Item. Using ‘Visual Basic’ as the template, select Web Form, leave the form name as Default.aspx and click add.
Step One
In the source view of Default.aspx, place a Localize and Button control in the open div tags. Add “Localize Text” to the Text of the Localize control and change the Text of the Button control to “Change Localize Text”.
Code Block
Default.aspx
Add a Localize and Button control.<asp:Localize ID="Localize1" runat="server" Text="Localize Text"></asp:Localize>
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Change Localize Text" />
We used over 10 web hosting companies before we found Server Intellect. They offer dedicated servers, and they now offer cloud hosting!
Step TwoSwitch to design view and double click the “Change Localize Text” Button control to generate a click event in the code behind. Every time the button is clicked, the code inside the Button1_Click event method will execute. This event will use the Localize control to display static text by changing the Text value.
Code Block
Default.aspx.vb
Change the text of the Localize control.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Localize1.Text = "Localize Text Changed!"
End Sub
We stand behind Server Intellect and their support team. They offer dedicated servers, and they are now offering cloud hosting!
OutputSave and run the web site. You should see a simple “Localize Text” and Button control on the page. When you click the button, the text will change to “Localize Text Changed!”, thus changing and displaying static text.
Thanks for reading and make sure to download the source files to get a better understanding of how the code works.
LocalizeControl-VB.zip
