Chapter . Introduction

ASP.NET is Microsoft’s flagship technology for building highly interactive, highly scalable websites. Some of the largest websites hosted on the Internet were built with the ASP.NET Framework, including the Dell website (www.Dell.com), parts of the Martha Stewart website (www.MarthaStewart.com), parts of the eBay website (www.eBay.com), the XBOX website (www.xbox.com), the MySpace website (www.MySpace.com), and the Microsoft website itself (www.Microsoft.com). If you need to build a highly interactive website that can scale to handle thousands of simultaneous users, then ASP.NET is the technology to use.

The ASP.NET 2.0 Framework is the latest version of the Microsoft ASP.NET Framework. The ASP.NET 2.0 Framework introduces more than 50 new controls. However, simply counting the number of new controls does not provide you with an accurate picture of the extent of the new features included in the ASP.NET 2.0 Framework. Many of the most important changes are framework-level changes.

Following are just a few of the significant new features of ASP.NET 2.0:

  • A new declarative data access model—. By taking advantage of the new data access controls, you can display and edit a set of database records without writing a single line of code.

  • Master Pages and Themes—. By taking advantage of Master Pages and Themes, you can easily create a common style and layout for all the pages in your website.

  • Membership API—. By taking advantage of the Membership API, you can build an entire user registration system that stores user information in a Microsoft SQL Server database table or Active Directory without writing any code.

  • Web Parts—. By taking advantage of Web Parts, you can build portal applications that can be customized by users or administrators at runtime.

  • SQL Cache Invalidation—. By taking advantage of SQL Cache Invalidation, you can cache database records in memory and reload the records automatically when the data in the underlying database changes.

  • AJAX—. By taking advantage of AJAX, you can update a web page without posting the page back to the web server.

Who Should Read This Book?

ASP.NET 2.0 Unleashed is intended for professional programmers who need to create a website. This book is a comprehensive reference for building websites with ASP.NET 2.0. The CD that accompanies this book contains hundreds of code samples that you can start using immediately while building your website.

If you are new to building websites with ASP.NET, you can use this book to teach yourself everything you need to know to build one with the ASP.NET Framework. If you are an experienced ASP.NET developer, you can use this book to learn about the new features of ASP.NET 2.0.

The final part of this book contains a complete sample application: an online store. The complete code for this application is included on the CD that accompanies this book.

What Do You Need to Know Before You Read This Book?

This book assumes that you know either the Visual Basic .NET or C# programming language. If you are completely new to the .NET Framework, then I recommend that you read an introductory book on either Visual Basic .NET or C# before reading this book.

In the body of the book, all the code samples are presented in Visual Basic .NET. However, this was not intended as any kind of insult to C# programmers. The CD that accompanies this book includes every code sample translated into the C# programming language.

To get the most from the database chapters, you should have some experience working with a database such as Microsoft SQL Server, Oracle, or Microsoft Access. You should know how to perform basic database operations with SQL.

Changes to This Book

This book has been completely rewritten from the first edition. I dumped the first edition of the book from my laptop’s hard drive and started from scratch.

The first edition of this book, ASP.NET Unleashed, was written five years ago when the first version of the ASP.NET Framework was released. Like most developers, I’ve undergone a number of changes over the last five years.

First, you’ll notice that this edition of this book emphasizes web standards much more than the first edition. When I wrote the first edition of this book, I didn’t care about web standards. At that time, I assumed that Internet Explorer had won the browser wars and the only thing that mattered was getting pages to work in Internet Explorer.

I was young, stupid, and naive. After the first edition of this book was published, a new browser named Firefox appeared. Everyone, once again, is starting to be concerned with creating cross-browser–compatible websites. The best way to create cross-browser–compatible websites is to follow web standards.

All the code samples in this book were written to conform to both XHTML and accessibility standards. You’ll notice that almost all the page layout and formatting is performed with Cascading Style Sheets. Furthermore, the book includes notes on how to use different technologies included with the ASP.NET Framework in a manner that is compatible with web standards.

You’ll also notice that the screenshots in this book do not all display Internet Explorer. To emphasize the fact that you can build standards-compliant web pages with ASP.NET, I rotated the screenshots among Internet Explorer, Firefox, and Opera.

Second, like many developers, I’ve become obsessed with the topic of AJAX (Asynchronous JavaScript and XML). AJAX enables you to build web applications that more closely resemble desktop applications. By taking advantage of AJAX, you can update content in a web page without posting the page back to the web server.

I was very happy to learn that Microsoft included the basic infrastructure that you need to build AJAX applications as part of the ASP.NET 2.0 Framework. AJAX samples are scattered throughout this book. In Chapter 7, for example, you learn how to display different quotations randomly in a page by using AJAX. In Chapter 33 you learn how to insert, edit, and display database records by using AJAX.

How This Book Is Organized

Although I encourage you to read this book from start to finish, reading chapter by chapter, I realize that not everyone has time to do so. If necessary, you can use this book solely as a reference and jump to a chapter only when the need arises. It may be helpful, therefore, to have an idea of the overall organization of this book.

  • Part I: Building ASP.NET Pages—. The chapters in this part provide you with an overview of the basic controls included in the ASP.NET Framework. You learn how to build interactive Web Forms with the form controls. You also learn how to validate form data with the validation controls. Finally, you learn how to upload files and display interactive calendars and wizards with the rich controls.

  • Part II: Designing ASP.NET Websites—. The chapters in this part discuss how you can create a common layout and style for the pages in your website. You learn how to use Master Pages to share content across multiple pages. You also learn how to use Themes to create a consistent page style.

  • Part III: Performing Data Access—. The chapters in this part focus on data access. You learn how to use the new GridView control to display, page, sort, and edit a set of database records. You learn how to use the new DetailsView and FormView controls to display and edit a single database record at a time.

  • Part IV: Building Components—. The chapters in this part focus on building custom components. You learn how to design and create multi-tiered applications. You also learn how to build data access components by taking advantage of the new features of ADO.NET 2.0. For example, you learn how to build a Stored Procedures with the .NET Framework.

  • Part V: Site Navigation—. The chapters in this part discuss the new navigation controls such as the TreeView and Menu controls. You learn how to use these controls with a Site Map to allow users to navigate a website easily. You also learn how to use the VirtualPathProvider class to abstract a website from the file system. For example, you learn how to store the pages in a website in a Microsoft SQL Server database.

  • Part VI: Security—. The chapters in this part focus on the new Login controls and Membership API. You learn how to create a user registration and authentication system. You learn how to store Membership information in either a SQL Server database or Active Directory.

  • Part VII: Building ASP.NET Applications—. The chapters discuss a variety of topics related to building ASP.NET applications. For example, you learn how to improve the performance of your ASP.NET applications by taking advantage of caching. You also learn how to localize your ASP.NET applications so that they can be translated easily and presented in multiple human languages.

  • Part VIII: Building Applications with Web Parts—. The chapters in this part are devoted to Web Parts. By taking advantage of Web Parts, you can build portal applications that can be customized by users or administrators at runtime.

  • Part IX: Custom Control Building—. The chapters in this part concentrate on extending the ASP.NET Framework with custom controls. For example, you learn how to create a WebWindow control that enables you to create virtual windows in a web page.

  • Part X: Sample Application—. The last part of this book contains a single chapter that describes a sample application. There you learn how to build an e-commerce website with the ASP.NET Framework: the ASP.NET Beer Store.

Viewing the Code Samples

All the code samples for this book are included on the CD that accompanies this book. If you want to view the code samples for a particular chapter, copy the corresponding folder from the CD onto your local hard drive and open the folder in Microsoft Visual Web Developer.

The code samples are also posted at the Superexpert website (www.superexpert.com). You can view “live” versions of any of the code samples by visiting this website. Please visit the Superexpert website to view the latest errata and content updates for this book, as well.

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

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