O'Reilly logo

Professional ASP.NET 3.5 AJAX by Matt Gibbs, Dan Wahlin, Bill Evjen, Dave Reed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.2. Using the Type System

The JavaScript language has a familiar syntax if you are used to C#, Java, or C++. However, as you saw in Chapter 3, JavaScript does not have built-in support for most object-oriented programming (OOP) concepts. This is not a problem by itself, but as you switch back and forth between C# or Visual Basic and JavaScript, you may find that you miss the familiar OOP constructs you are used to in the richer languages.

When using JavaScript, there is no support for inheritance of types and no standard way of declaring interface definitions or enumerations. What's a developer to do? In the past, it meant that you adopted your own conventions in writing JavaScript. This becomes problematic as more people with unique approaches are added to a project, because there can be inconsistencies that make maintenance and new development more difficult. ASP.NET AJAX provides the ability to leverage OOP constructs when writing JavaScript. You will see many small code examples that demonstrate a set of recommended standard patterns and show how the Microsoft AJAX Library functions are used.

The AJAX Library brings classic OOP concepts to JavaScript. It adds namespace support for grouping functionality. It also provides helpful debugging facilities, a schema for providing type information, and a means for localizing string and image resources.

Part of the ASP.NET team's motivation for creating the AJAX Library and these patterns for development was to make JavaScript coding ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required