Académique Documents
Professionnel Documents
Culture Documents
Globalization in ASP.NET
International applications should be customizable according to the preferences of users belonging to different nations, cultures, or regions. User preference refers to the language, currency, and date formats. The structure of an internationalized application is divided into two blocks: Code block Data block
Internationalization includes three phases: Globalization: Involves writing the executable code for an application in such a way that makes it culture-neutral and language-neutral. Localizability: An application that has been globalized must be tested to ensure that its executable code is independent of the culture and language-specific data. Localization: Involves the customization of an application for a specific locale. One major task in this phase is the translation of resources identified during the globalization phase.
Character Encoding Encoding is the scheme for representing characters in a numeric format. The characters from different languages are grouped into a set called a character set. There are two very commonly used character sets. They are: American National Standards Institute (ANSI): Includes 256 characters and punctuations. In ANSI, every character is represented using one byte (8-bit). Unicode: In Unicode, every character is represented using 2 bytes (16-bit).
Mirroring While creating internationalized Web applications, you need to consider the fact that there are languages that are read from the right to the left. In case of Right-To-Left (RTL) languages, the alignment of text and the layout of different UI components, such as menus and buttons, are reverse of the normal flow. Mirroring is the transformation of coordinates. Validating Nonlatin User Input A language that does not follow the Latin script is called a nonlatin language. The Char structure exposes some validation methods that can be used to determine the category of a nonlatin alphabet input in the same way as a Latin alphabet input.
Working With Resources A resource is any non-executable data that is logically deployed with an application. A separate resource file should be created for each culture for which the application is to be customized. You can use the Resource File Generator (ResGen.exe) command prompt utility to convert a resource file in the text format into the binary format. The output of creating resource-only assemblies will be a DLL file, which will contain all the resource files you added. Satellite assemblies are resource-only assemblies that contain only culture-specific resources. The System.Resources namespace provides different classes, which enable you to retrieve values from resource files.
8
Configuring a Web Application for Globalization: In ASP.NET, you can use the Web.config file to configure an application for globalization. The <globalization> tag has the following attributes: requestEncoding responseEncoding fileEncoding culture UiCulture
Ajax.NET
1st AJAX library for Microsoft .NET
10
11
Source-code doesnt change if you want to use the method in server-side code
DemoMethods dm = new DemoMethods(); int age = dm.GetAge(michael);
12
DataSet, DataTable, DataRow, ArrayList, Array, DateTime, TimeSpan, Create your own IAjaxObjectConverters
13
14
15
16
17
Disable/enable cache from the client-side More Enumeration support for client-side, export enumerations to compare values
if(res.value == MyEnumType.Manager){}
18
A more complex event handler for JavaScript events from server-side code
Server-side code: Watcher watcher = new Watcher(); watcher.Changed += new AjaxWatchEventHandler(); Client-side code: ajax.OnWatchEvent = function(){}
Server.TransferSilent/RedirectSilent
used for web sites (instead of web applications) to get rid of the postback and full page reload
19
20