Back to description
Over the years, we developers have seen many changes in terms of how development occurs. We have gone from terminal-based... more
Over the years, we developers have seen many changes in terms of how development occurs. We have gone from terminal-based programming to PC-based programming to Windows-based programming and to the Web. Now we are on the verge of another programming revolutionone that will bring about more interactive user interfaces to web applications. This programming revolution is brought to developers courtesy of a set of technologies that are generally known as AJAX (Asynchronous JavaScript And XML). No longer will users see the annoying flash with the clicking of a button to submit data. No longer will users lose the context of where they are located and be thrown back up to the top of a page. With AJAX, developers can build applications that step out of the traditional postback model of the Web, provide an improved user interface to users, and allow developers to develop applications that are much friendlier to use.
This chapter looks at the following:
ASP.NET development and how it led to AJAX
What AJAX is and a high-level overview of some of its base technologies
The advantages of AJAX
What ASP.NET AJAX is
Some things that it might not make sense to do with AJAX
... less
ASP.NET AJAX installs templates that make it quick and easy to create new web applications that leverage its features. In... more
ASP.NET AJAX installs templates that make it quick and easy to create new web applications that leverage its features. In addition, it is fairly straightforward to update existing ASP.NET applications to allow them to support ASP.NET AJAX controls and functionality. The biggest challenge in setting up an application to use ASP.NET AJAX involves adding a number of settings to the web.config file. In the case of a new application, project templates are installed with the ASP.NET AJAX installation to make this task easy. For existing applications, follow the steps in this chapter to ensure they are properly configured to take advantage of ASP.NET AJAX’s features.
web.config
In this chapter, you learn about the following:
Installing ASP.NET AJAX
Creating an ASP.NET AJAX application
Adding ASP.NET AJAX to an existing ASP.NET application
ASP.NET AJAX has a unique, yet familiar architecture that builds on the foundations of ASP.NET 2.0 to strengthen its weak... more
ASP.NET AJAX has a unique, yet familiar architecture that builds on the foundations of ASP.NET 2.0 to strengthen its weak points. This chapter begins by discussing those weak points and describing how ASP.NET AJAX strengthens ASP.NET with powerful new features.
In this chapter you also learn key conceptual details about the ASP.NET AJAX framework, including client-side and server-side development and configuration details. Before you build a house (or a web site), you should have a solid foundation, and this chapter provides you with the foundational details you need to become a skilled ASP.NET AJAX developer.
Specifically, this chapter covers a variety of topics, including:
Analyzing the foundations of ASP.NET AJAX
Understanding the code library
Working with the compatibility layer
Exploring the Microsoft AJAX Library
Stepping through the client-side event life cycle
Investigating server-side components and controls
Learning about the JavaScript files that get downloaded to the client
Understanding how handlers are used
Working with ASP.NET AJAX web.config files
Calling web services is an important part of AJAX. Web services are the base mechanism used to transmit data between the... more
Calling web services is an important part of AJAX. Web services are the base mechanism used to transmit data between the client and the browser without the need for a postback. Calling a web service instead of performing a postback has several advantages, including less network traffic and generally higher performance.
Microsoft’s ASP.NET AJAX framework provides mechanisms that allow for AJAX-style operations. With this type of support, asynchronous commands can be sent between the client web browser and the web server. This communication is made through web services. This chapter looks at the following topics:
Understanding AJAX
Using client-side JavaScript
Sending and receiving data with client-side JavaScript
Setting up web services to be called
The... more
The UpdatePanel is absolutely the coolest control included in the ASP.NET 2.0 AJAX Extensions 1.0. The UpdatePanel provides support for implementing AJAX-style operations by integrating the server-side development methodology that is well known to ASP.NET developers with the client-side AJAX development paradigm.
UpdatePanel
This chapter looks at the following topics:
What the UpdatePanel is
How the UpdatePanel works
How to provide full support for all browsers through the UpdatePanel
The client-side web page life cycle
The ASP.NET AJAX Control Toolkit is a community project initiated by Microsoft that provides a set of controls based around... more
The ASP.NET AJAX Control Toolkit is a community project initiated by Microsoft that provides a set of controls based around the Microsoft AJAX Library and AJAX ASP.NET 2.0 Extensions 1.0. These controls are free for use within your own applications and provide features and behaviors far beyond those supplied in the Microsoft AJAX Library and ASP.NET 2.0 Extensions 1.0. You can think of the Microsoft AJAX Library and ASP.NET 2.0 Extensions 1.0 as the core framework (much like the .NET framework base class library itself), and the ASP.NET AJAX Control Toolkit as a set of controls built on top of that framework (much like the ASP.NET server-based controls or Windows Forms–based controls).
The Control Toolkit is a lot more than just a reusable set of controls, however. Complete with IntelliSense and designer support, it also provides a framework for building your own AJAX extender controls, and alleviates much of the common coding required to implement server-based controls.
It provides comprehensive cross-browser support, much like the ASP.NET 2.0 AJAX Extensions 1.0 and AJAX Library itself. Internet Explorer, Firefox, and Safari are among the major browsers supported with support for browsers such as Opera included where possible.
This chapter covers exactly what the Control Toolkit is from a community project perspective, examines controls within the Toolkit, and also covers the controls provided for developers wishing to create their own extender controls using the Control Toolkit. Specifically, you learn about the following topics:
What a community project managed by Microsoft really means
How to install the Control Toolkit
What an extender control is
How the controls within the Control Toolkit can be used
What features and support the Control Toolkit provides for developers wishing to create their own extender controls
How you can contribute to the Control Toolkit project
In the previous chapter, you saw how the ASP.NET AJAX Toolkit controls utilized the concept of an extender control to augment... more
In the previous chapter, you saw how the ASP.NET AJAX Toolkit controls utilized the concept of an extender control to augment the behavior of existing controls within your application. An extender control is typically targeted at another control, and provides enhanced functionality for that control, and perhaps other controls as well.
There are really two types of controls that form the basis of the control set within ASP.NET AJAX 2.0 Extensions: script controls and extender controls. Both form part of the core framework of ASP.NET 2.0 AJAX Extensions.
Script controls are standalone controls that define their own behavior and operate independently of other controls (although often in conjunction with other controls). A good example of this is the UpdatePanel or the Timer control.
Timer
Extender controls operate in tandem with at least one other control on a page, and extend the functionality of that control. You saw this concept demonstrated extensively in Chapter 6 on the AJAX Control Toolkit. A good example is the TextboxWatermarkExtender that ships with the Toolkit, which extends a regular Textbox control. You saw how extender controls can be used within your applications in various ways to achieve rich, dynamic behavior, often without the need to write any JavaScript code.
TextboxWatermarkExtender
Textbox
This chapter details concepts and techniques required to build your own extender controls and provide reusable custom behavior for your AJAX applications. Specifically, this chapter covers:
Extender control features within the core framework
Building your own extender control using only the core functionality of ASP.NET 2.0 AJAX Extensions
The enhanced framework and features provided by the AJAX Control Toolkit for building extender controls
Building the same extender control using the AJAX Control Toolkit
Advantages and disadvantages of both approaches
JavaScript is a very simple language for adding functionality to a web browser application. However, it is lacking in several... more
JavaScript is a very simple language for adding functionality to a web browser application. However, it is lacking in several areas that formal programmers consider important. With the introduction of ASP.NET AJAX, Microsoft has added enhancements for JavaScript, and these enhancements address the perceived shortcomings in JavaScript. Some of the enhancements you look at in this chapter include the following:
Extended support for basic data types, such as numbers and strings.
The creation of namespaces and classes.
The notion of inheritance and interfaces.
Note
JavaScript has no concept of private members. There will be properties shown whose name starts with an underscore (_), and these properties are considered to be private. As a result, you should not use them in your code even though you can access them.
_
This chapter explains what the Microsoft AJAX Library is and how to use some of the classes. It goes over some of the more... more
This chapter explains what the Microsoft AJAX Library is and how to use some of the classes. It goes over some of the more useful features of the Library you might use more often than others. The examples are going to be mostly in JavaScript because the way you call these from VB and C# is nearly identical. In fact, the only real difference is the first line of code in your .aspx page:
<%@ Page Language="C#" %>
or
<%@ Page Language="VB" %>.
The Microsoft AJAX Library is a set of classes that provide a rich framework that greatly simplifies web client programming with JavaScript. It contains several namespaces that are very helpful in creating clean client code that very much feels like what you are familiar with in C#. This chapter consists of a list and description of each namespace and class and then goes into several of the classes in the Sys.* namespaces. The “The Sys Namespace” section explains how to use a few of the popular classes including the Sys.EventHandler class and the Sys.Debug class, among others. The “The Sys.Net Namespace” section explains how to use the popular networking classes and how to manage communication between Microsoft ASP.NET AJAX client applications and web services on the server. The final section, “The Sys.Serialization Namespace,” explains how and when you might want to serialize JavaScript types into JSON-formatted data.
Sys.*
Sys.EventHandler
Sys.Debug
In this chapter, you take a look at the following:
A description of all the namespaces in the client library
Which classes make up the Sys namespace
Sys
Examples using the Sys.StringBuilder class
Sys.StringBuilder
How the underlying Sys.WebRequest class works
Sys.WebRequest
JavaScript serialization
Event handling in the Microsoft AJAX Library
By this point in the book you should have a good understanding of how ASP.NET 2.0 AJAX makes it easy to provide functionally... more
By this point in the book you should have a good understanding of how ASP.NET 2.0 AJAX makes it easy to provide functionally enhanced user interfaces to end users. This chapter focuses more on the visual enhancements that ASP.NET 2.0 AJAX provides and explains how they work. It just so happens that one of the best visual enhancements is also one of the best functional enhancements. ASP.NET AJAX asynchronous postbacks are not only useful and efficient, but also pleasing to the eye. With a little effort, however, they can be made even more pleasing. Here’s a summary of the topics covered in this chapter:
Understanding the differences between asynchronous and synchronous postbacks
Notifying users during asynchronous postbacks
Using the UpdatePanelAnimation extender
UpdatePanelAnimation
Providing feedback during ongoing operations
Aborting operations
Handling exceptions gracefully
Some of the most valuable features of ASP.NET 2.0 are the Membership and Profile services APIs. Saving developers countless... more
Some of the most valuable features of ASP.NET 2.0 are the Membership and Profile services APIs. Saving developers countless hours of development time, these services are an extensible foundation for identifying and authorizing users of a web application and persisting personal preferences. This chapter teaches you how to use Microsoft ASP.NET 2.0 AJAX integration with ASP.NET services to provide AJAX-style login and user-customized experiences.
The following topics are covered in this chapter:
How to enable your site for AJAX support of ASP.NET application services
How to use Microsoft ASP.NET 2.0 AJAX to build login, logout, and profile features for your web site
So you have written your first ASP.NET AJAX application or you have upgraded an existing web site to utilize some features... more
So you have written your first ASP.NET AJAX application or you have upgraded an existing web site to utilize some features of ASP.NET AJAX and it all works straight away, without issue, right? Unfortunately, this is rarely the case, and at some point in time in any form of application development, AJAX or otherwise, you need to debug your application.
Debugging is the art of identifying and removing problematic code within your applications. Every developer has been required to perform some degree of debugging within their applications, at some point in time.
ASP.NET is predominately a server-side development technology and support for debugging of applications within ASP.NET is quite extensive. ASP.NET AJAX applications introduce some new aspects, which in turn introduce some new debugging challenges. The extensive use of JavaScript, and the fact that custom data may be transferred through the use of asynchronous postbacks, means that attention needs to be paid to these significant areas to deal with the challenges that are introduced when debugging AJAX-type applications with ASP.NET.
This chapter examines the various aspects of debugging ASP.NET AJAX applications and covers the following topics:
General server-side ASP.NET debugging
General JavaScript debugging
Specific debugging support provided by the ASP.NET AJAX Extensions
HTTP debuggingexamining what gets transferred asynchronously
Microsoft’s ASP.NET AJAX framework consists of three parts. So far this book has talked about the main features of the Core... more
Microsoft’s ASP.NET AJAX framework consists of three parts. So far this book has talked about the main features of the Core bits and the AJAX Control Toolkit. This chapter provides an overview of the last set of features, collectively part of the ASP.NET AJAX Futures CTPwe will be making updates to the code samples online (www.wrox.com) as the CTPs change. Nothing is guaranteed to be in the Futures CTP, and some bits will be cut out and not put into the next release based on feedback and testing.
www.wrox.com
The following are the main features of the ASP.NET AJAX CTP as it exists at the time of the ASP.NET AJAX 1.0 release:
XML-Script
Data binding
Drag and drop
Bridging
Silverlight with AJAX
One of the goals of this book is to allow a beginner to run the code with as little modification as possible. Because we are unable to know what changes are in store for the features within the ASP.NET AJAX Futures CTP, we decided not to cover these features in the printed book. Instead, we felt it best to provide some simple examples in the online content that goes with this book. To access the online content, go to www.wrox.com and search for “Beginning ASP.NET 2.0 AJAX.”
Purchase Before purchasing this product, please be sure you have met all software and system requirements, and that you understand any limits placed upon its use.
Return Policy Wrox Chapters on Demand are non-returnable and non-refundable.
Watermarking Wrox Chapters on Demand are sold with a small unique watermark at the bottom of each page identifying the purchaser name, email address, and order number.
Reader Software Wrox Chapters on Demand are offered as PDFs, and they can be viewed using the Adobe Reader, ADE, or a compatible PDF reader. If you do not have the Reader installed, it can be downloaded for free at Adobe.com.
Test Download As Wrox Chapters on Demand purchases are non-returnable, it is advisable that you test your system and software configurations with a free sample download before you place an order.
Usage Rights for a Wrox Chapters on Demand File Any Wrox Chapters on Demand product you purchase from this site will come with certain restrictions that allow Wiley to protect the copyrights of its products. After you purchase and download this title, you:
If you have any questions about these restrictions or need any further assistance please refer to Technical Support (www.wiley.com/techsupport) or call (877) 762-2974 (8 a.m. - 5 p.m. EST, Monday - Friday).
Related Books