Using with the jQuery Globalization Plugin in ASP.NET | WebReference

Using with the jQuery Globalization Plugin in ASP.NET

By Joydip Kanjilal


The jQuery Globalization Plugin provides globalization support to your ASP.NET Web applications that can make use of JavaScript. You can use the jQuery Globalization plugin to easily parse numeric, currency and date values using appropriate cultures. This article provides a head start on how we can get started using this plugin with relevant code examples and snippets wherever applicable.

To get started with jQuery you should have the following installed in your system:

  1. Visual Studio 2008
  2. Visual Studio 2008 SP1
  3. jQuery Library
  4. Visual Studio 2008 jQuery Plug-in

Alternatively, you can simply download and use Visual Studio 2010 as it comes with in-built support for jQuery. If you have Visual Studio 2010 in your system, you would the jQuery library with it by default.

Before we delve deep into using the jQuery Globalization plugin, let's take a quick tour of jQuery and understand why it is so useful.

What Is jQuery?

jQuery is a simple, lightweight and fast JavaScript library that has simplified the way you write your scripts these days. It is all set to become the framework of choice for building fast and responsive Web applications in the years to come. JQuery is a widely popular open source, cross browser, light weight JavaScript library that simplifies event handling, animations and developing Ajax-enabled Web pages. JQuery provides a common browser API that provides cross browser support and its usage reduces the amount of code you need to write otherwise, drastically. JQuery provides excellent support for browser independence, seamless extensibility, support for Ajax, and support for manipulating DOM elements and a simplified event handling model.

The jQuery Globalization Plugin adds globalization support to your Web application. In the sections that follow, we will take a look at what this plugin is all about and how we get started using it.

The jQuery Globalization Plugin -- What Is It?

Before we get started using the jQuery Globalization plug-in, the first thing that would come to our mind is, what is globalization and why is it needed, right? Localization and Globalization are two important concepts related to Web programming. While the former relates to adapting the application to suit different locales, the latter relates to identifying and changing the specific areas of your application so as to enable it to work for different locales. You have built-in support for globalization and localization in Microsoft .NET Framework through the System.Globalization, System.Resources, and System.Threading namespaces.

The jQuery Globalization Plugin provides support for globalization in your applications. The jQuery Globalization Plug-in provides support for over 350 cultures. Scott Guthrie says in his blog: "The jQuery Globalization plugin enables you to easily parse and format numbers, currencies, and dates for different cultures in JavaScript." (Reference: "jQuery Globalization Plugin from Microsoft"

Note that the jQuery Globalization plugin is distributed under the same license as the core jQuery library, so, you can be safe to use it and play with it. You can download a copy of the jQuery Globalization Plug-in from GitHub.