Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ASP.NET 3.5 Application Architecture and Design

You're reading from   ASP.NET 3.5 Application Architecture and Design Build robust, scalable ASP.NET applications quickly and easily.

Arrow left icon
Product type Paperback
Published in Oct 2008
Publisher Packt
ISBN-13 9781847195500
Length 264 pages
Edition Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Vivek Thakur Vivek Thakur
Author Profile Icon Vivek Thakur
Vivek Thakur
Arrow right icon
View More author details
Toc

Incorporating Globalization


In our sample website, after creating the resource files and creating some localized data, we first start using the explicit localization to set the text of the controls such as the Labels in our web site so that they get their values from the resource files. Because in our example there are four languages, let us create four resource files, along with a fifth fallback resource file (with no locale name). Here is a screenshot of these files:

Note that the resource files have the locale as their middle names, so we need to set the UICulture to the same named locale so that ASP.NET can access these resource files.

But the problem is, how do we change the culture dynamically on the postback event? Fortunately, ASP.NET provides a method in the Page class to override InitializeCulture(). This method executes very early in the page life cycle (much before any control is generated), and here we can set the UICulture and Culture of the current thread.

Because this method...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image