Chapter 3. JavaScript for the ASP.NET Developer

As an ASP.NET developer, you are used to writing code using a high-level language such as C# or Visual Basic. The main development tool for .NET developers, Visual Studio, provides Intellisense that makes coding in these languages easier. Also using Visual Studio, you will find that there is rich support for debugging the code, and you get warnings and errors about many things during compilation. Visual Studio will even background-compile your code and give you updated warnings as you go to help you find problems without needing to perform an explicit compilation. The .NET Framework provides a comprehensive set of class libraries that can be used from any .NET-compatible language and helps to simplify complex programming tasks. With that said, many developers who are focused on the Web realize that writing JavaScript is an entirely different world in this regard.

This chapter introduces you to JavaScript with a bias toward the ASP.NET developer. You will see how JavaScript development is different from what you are used to with .NET languages. In addition, you will see how the browser gets JavaScript. This chapter introduces the basics of the language and explains the closure and prototype aspects of JavaScript coding, along with some techniques to apply for writing faster and more efficient JavaScript. If you look at the code of the Microsoft AJAX Library, you will see that the Microsoft ASP.NET team also uses these tactics in their ...

Get Professional ASP.NET 3.5 AJAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.