About this Book

ASP.NET is a Microsoft technology for building web applications that leverages all the fantastic technologies you can find in .NET Framework.

The book will move you from apprentice to master of ASP.NET by giving you specific techniques to solve problems you are likely to encounter. Each technique has a problem, solution, and discussion section. You might think of this book as a guided tour through ASP.NET best practices; we’ll introduce each scenario, solve the problem, and then discuss the results. Once you’ve read this book, you’ll have a better understanding of the most important aspects of designing, building, and maintaining ASP.NET-based applications.

You’re going to find many devices in this book that will help you in the learning process:

  • Figures—Pictures that show a workflow or summarize concepts
  • Listings and snippets—Pieces of code that show the solution to a problem
  • Tables—Visuals that summarize a list of features or options

We hope these devices will help make concepts clearer and the learning process faster.

Who should read this book?

This book targets developers who are working on everything from the smallest home application to the largest enterprise application. ASP.NET can be useful in simple scenarios, where you can apply most of the RAD features provided by Visual Studio 2010, as well as in enterprise applications, where its roots in .NET Framework offer a wider range of possibilities.

Roadmap

This book is designed for you to improve your ASP.NET expertise and is organized into sixteen chapters divided into five parts and two appendixes.

Part 1: ASP.NET fundamentals

In part 1, we introduce ASP.NET fundamentals. For those of you who are already somewhat familiar with ASP.NET, this part serves as a refresher before moving forward.

Chapter 1 provides an introduction to ASP.NET, with a focus on the Web Form’s model.

Chapters 2 and 3 cover data access strategies in web applications. You’ll learn the best practices for data access and how to leverage them in your application.

Part 2: ASP.NET Web Forms

Part 2 covers how to use ASP.NET Web Forms, the original model provided in ASP.NET to build the user interface.

Chapter 4 takes a tour into ASP.NET Web Forms, covering the most common scenarios. You’ll also learn about the new features offered by version 4.0, how to use master pages to their fullest extent, and how to leverage URL routing.

Chapter 5 deals with one of the most common activities for a developer: using data binding and how to fully integrate this feature into your applications.

Chapter 6 covers an important extensibility point in ASP.NET Web Forms and shows how to build custom controls. You’ll start with the basics and analyze complex scenarios.

Finally, chapter 7 explains how to control the markup generated by ASP.NET. You’ll learn how to produce better markup and how adaptive rendering works.

Part 3: ASP.NET MVC

In part 3, we investigate the option to build your UI with ASP.NET MVC; after all, Web Forms aren’t the only model you can use to do that.

ASP.NET MVC is a new option added in ASP.NET 3.5 SP1 and directly integrated into ASP.NET 4.0 as ASP.NET MVC 2.0. It’s not the new Web Forms, but rather a different approach to solve the same problem. ASP.NET MVC lets you use the Model-View-Controller (MVC) pattern, and is built with testability and great markup control in mind.

Chapter 8 contains an introduction to ASP.NET MVC and shows the potential that this new toolkit offers when you’re building the UI. You’ll learn how to perform the basic actions that you’re already acquainted with in ASP.NET Web Forms.

Chapter 9 covers how to customize and extend ASP.NET MVC in order to unlock the full potential that it offers.

Part 4: Security

In part 4, we take a look at one of the most important concerns of every web application: how to protect and make your code secure.

In chapter 10, we analyze the most common issues when dealing with security. You’ll learn how to build stronger applications, how to avoid common errors, and how to preserve your application’s integrity. You’ll find plenty of helpful suggestions throughout the chapter.

Chapter 11 covers authentication and authorization in ASP.NET. It will show you how to build a secure area, how to leverage ASP.NET’s infrastructure, and how to build a custom provider to extend the existing features provided by ASP.NET’s Membership and Roles APIs.

Part 5: Advanced topics

Finally, part 5 is dedicated to more advanced scenarios and combines many of the topics previously addressed in this book. These chapters cover both ASP.NET Web Forms and MVC.

Chapter 12 covers how to integrate an ASP.NET application into an Ajax-enabled application and RIAs (Rich Internet Applications). We’ll also take a look at how to leverage jQuery and ASP.NET Ajax.

In chapter 13, you’ll learn how to handle state in ASP.NET—from cookies, to ViewState, to new features introduced in version 4, like the ability to compress the SessionState.

Chapter 14 is dedicated to caching. You’ll find plenty of tips on how to achieve better scalability by implementing a good caching strategy. You’ll also learn how to build custom cache providers and how Microsoft AppFabric caching works.

Chapter 15 contains miscellaneous topics related to fully extending ASP.NET, from HttpRuntime, to logging, to building a virtual path provider.

Last, chapter 16 offers some tips on how to build applications that perform better, with topics like content minifying, multithreading, and ParallelFX.

Code conventions and downloads

All the code used in this book is in a monospace font like this. The .NET code is in both C# and Visual Basic so that you’re comfortable with the code, regardless of the language you are using. The language is indicated immediately above the relevant code. For longer lines of code, a wrapping character might be used so the code is technically correct while conforming to the limitations of a printed page. Code annotations accompany many of the listings, highlighting important concepts. In some cases, numbered bullets link to explanations that follow the listing.

Source code for all working examples in this book is available for download from the publisher’s website at www.manning.com/ASP.NET4.0inPractice.

Author Online

The purchase of ASP.NET 4.0 in Practice includes free access to a private forum run by Manning Publications where you can make comments about the book, ask technical questions, and receive help from the authors and other users. You can access and subscribe to the forum at www.manning.com/ASP.NET4.0inPractice. This page provides information on how to get on the forum after you’re registered, what kind of help is available, and the rules of conduct in the forum.

Manning’s commitment to our readers is to provide a venue where a meaningful dialogue between individual readers and between readers and the authors can take place. It isn’t a commitment to any specific amount of participation on the part of the authors, whose contributions to the book’s forum remain voluntary (and unpaid). We suggest you try asking the authors some challenging questions, lest their interest stray! The Author Online forum and the archives of previous discussions will be accessible from the publisher’s website as long as the book is in print.

In addition to the Author Online forum available on Manning’s website, you can also contact us regarding this book, or anything else, through one of the following avenues:

All comments sent to these blogs are moderated. We post nearly all comments; but if you include your email address or phone number, we won’t post the comment out of respect for your privacy.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset