Chapter 13. Client-Side Behavior


Server-side processing has always been a core functionality of Web applications. In addition, client-side functionality ”or application logic that executes on the user 's machine ”is becoming an increasingly important feature of Web applications. Client-side features in a Web application are typically implemented in scripting languages such as JavaScript (also known as ECMAScript) and use the DHTML functionality offered by the latest versions of Web browsers. Client-side functionality enables a Web application to create an interactive user interface and to reduce the number of postbacks made to the server. This functionality also enables a Web application to reduce the work that needs to be done on the server.

At the same time, Web applications need to degrade gracefully and remain functional when they are accessed from Web browsers that do not provide the required level of client-scripting support. This requirement poses a substantial challenge to Web application developers and increases the complexity of their task. In addition to encapsulating server-side logic, server controls can encapsulate logic that takes advantage of available client functionality as well as logic that allows Web applications to degrade gracefully into purely server-side applications. This encapsulation of client-side behavior into server controls allows the code in the overall Web application to remain readable and maintainable . The most important benefit of this encapsulation is that server controls allow page developers to focus on the logic of their Web applications, rather than on targeting their applications for multiple Web browsers.

The validation controls in ASP.NET are an example of server controls that provide the functionality to validate form input on the client and reduce round-trips to the server. At the same time, the validation controls fall back on server-side validation when their client-side functionality is inactive. In this chapter, we will first introduce the concepts involved in incorporating client-side functionality into a server control's feature set. We will then implement an HtmlEditor server control that illustrates these concepts.



Developing Microsoft ASP. NET Server Controls and Components
Developing Microsoft ASP.NET Server Controls and Components (Pro-Developer)
ISBN: 0735615829
EAN: 2147483647
Year: 2005
Pages: 183

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net