This book is a collection of ASP.NET recipes that aims to help you quickly and efficiently solve many of the day-to-day problems you face developing web applications with the .NET platform. Our recipes run the gamut from simple coding techniques to more comprehensive development strategies that even the most experienced ASP.NET programmers will savor.
More than a compilation of tips and tricks, the ASP.NET Cookbook solves real-world programming problems and is rooted in our experience as professional programmers who have designed and built richly functional web-based projects for a variety of corporate clients . We think we know the kinds of problems that you face, and we aim to help you solve them.
The ASP.NET Cookbook also contains dozens of code examples ranging from relatively simple 10-liners to comprehensive multipage solutions. Without solid and complete working examples, it's difficult to make an informed decision about whether an approach is the right one, or whether you should be looking elsewhere. We are convinced that reading good example code is the best path to understanding any development platform, so we've included lots of it and commented our listings generously to help you follow the logic.
The ASP.NET Cookbook is written in classic O'Reilly cookbook style to focus directly on problems you face today or are likely to face in the future. Using a problem-and-solution format, we make it easy for you to skim for a near match to your particular problem. We have pared down the headings to a bare minimum so you can quickly assess whether a recipe is pertinent.
Many of us occasionally browse through cookbooks looking for new recipe ideas or exploring the nuances of a culinary style. Similarly, we hope you find this book sufficiently interesting to browse, because in many respects it is as much about software techniques and methodology as it is about ASP.NET. For example, we offer a full course of error-handling recipes because we believe the topic is important to our audience and there just isn't enough information about it in general circulation. We could have restricted our discussion to page-level error handling, but that seems inadequate to us. Instead, we prefer to help you deal with error handling at the application level, a more difficult subject but ultimately more useful to serious developers. We have already done the heavy lifting on this and many other important subjects so that you don't have to.
From our point of view, the complexity of web-based development projects is now equal to that of traditional large-scale software development where teams of specialists ” architects , developers, project managers, designers, and the like ”carry out a thoroughgoing development process. This is certainly not news to the many professional developers and others who have been working on Internet team development projects since early DARPA-NET days. What is new is that ASP.NET (and .NET in general) raises the bar for those in the Microsoft camp who consider themselves professional Internet developers but have yet to suffer the slings and arrows of improperly checked-in code, lack of coordination between designers and programmers, drifting project focus, mismanaged risks, and the host of other distractions that team development can bring.
The increased complexity of web projects has direct ramifications in our ASP.NET coding techniques and the organization of this book, and leads directly to some of the recommendations we make. For instance, we believe strongly in using the code-behind feature of ASP.NET to separate server-side code from the user presentation (HTML and content), because this approach allows developers, web designers, and information architects to work independently and concentrate on what each does best. Thus, every recipe we offer consistently splits the code and UI into separate files. There's a small price to pay for the reader who is attempting to decipher the relationship between the two and might prefer to see them bunched together for sake of readability, but we think their separation is worth the price. This approach also supports team development, where the separation of code and content is absolutely essential to good development practice.