Enable Page-Level Debugging 242
Enable Custom Error Handling 244
Handle Errors Programmatically 246
Use a Page-Level Trace 248
Use an Application-Level Trace 250
13) SECURITY AND ASP.NET _
Using Windows Authentication 252
Using Forms Authentication 256
Authorize Users 260
14) LOCALIZATION AND ASP.NET _
Set Up Encoding 262
Using CultureInfo 264
Using RegionInfo 266
Localize with the Page Control 268
Create and Use Resources 270
Use Resource Manager Information 272
15) MIGRATE FROM ASP TO ASP.NET
Work with Multiple Server-Side Languages 274
Work with Script Blocks 276
Using Render Functions 278
Using Page Directives 280
Migrate VBScript to VB.NET Syntax 282
Migrate JScript to JScript.NET Syntax 286
APPENDIX A: ASP.NET QUICK REFERENCE 288
APPENDIX B: C#, VB, AND JSCRIPT LANGUAGE
APPENDIX C: WHAT'S ON THE CD-ROM 300
HUNGRY MINDS END-USER LICENSE AGREEMENT 304
HOW TO USE THIS BOOK
ASP.NET: Your visual blueprint for creating Web applications on the .NET framework uses straightforward examples to teach you many of the tasks required to write Web applications on the .NET framework.
To get the most out of this book, you should read each chapter in order, from beginning to end. Each chapter introduces new ideas and builds on the knowledge learned in previous chapters. Once you become familiar with ASP.NET, this book can be used as an informative desktop reference.
If you are looking for a resource that will help you quickly get started creating ASP.NET Web pages, ASP.NET: Your visual blueprint for creating Web applications on the .NET framework. This book will walk you through the basics that you need to get started and familiarize yourself with the essentials of working with ASP.NET. This book also demonstrates advanced features of ASP.NET, such as creating custom components, configuration, debugging, security, and migration to ASP.NET from ASP 3.0.
No prior experience with ASP.NET is required, but familiarity with the operating system installed on your computer is an asset.
Experience with programming languages is also an asset, but even if you have no programming experience, you can use this book to learn the essentials you need to work with ASP.NET. The C# programming language is used for most of the tasks in this book.
To perform the tasks in this book, you need a computer with an operating system on which you can install the .NET framework. The tasks in this book are developed using Windows 2000 with IIS 5.0 installed. The computer will also need to have a text editor to create code, such as Notepad. Visual Studio 7.0 is not required to do the tasks in this book, although you can use it if you want. Many of the tasks in this book require a Web browser, such as Internet Explorer.
A number of typographic and layout styles are used throughout ASP.NET: Your visual blueprint for creating Web applications on the .NET framework to distinguish different types of information.
Indicates the use of C#, VB, or Jscript variable names, keywords, and other elements of ASP.NET code.
Indicates information that you must type. Italics
An Apply It section usually contains a segment of code that takes the lesson you just learned one step further. Apply It sections offer inside information and pointers that can be used to enhance the functionality of your code.
An Extra section provides additional information about the task you just accomplished. Extra sections often contain interesting tips and useful tricks to make working with ASP.NET easier and more efficient.
The Organization Of This Book
ASP.NET: Your visual blueprint for creating Web applications on the .NET framework contains 15 chapters and three appendices.
The first chapter, Getting Started with ASP.NET, explains how you can install the .NET framework and configure many of the options available when setting up your Web site.
Chapter 2, Web Development Basics, presents the fundamentals of working with ASP.NET including exploring and browsing your Web site, opening and saving files, and creating your first ASP.NET Web page. This chapter also shows you how to use the sample program templates on the CD-ROM.
Chapter 3, C# Basics, introduces you to the C# programming language, including how to work with variables, conditional statements, arrays, looping structures, strings, collections, and exception handling. This will prepare you for the material in later chapters if you are not familiar with the C# programming language. Chapter 4, Work with HTML Controls, gets you started with creating Web pages in ASP.NET that have buttons, text boxes, check-boxes, drop-down lists, and tables.
Chapter 5, Work with Web Controls, will show you how to add many of the common controls to Web pages like text boxes using ASP.NET Web controls. The chapter then demonstrates how to add special controls like calendars and advertisement banners. Finally, the chapter explains how to validate user input in ASP.NET. Chapter 6, Access Data with ASP.NET, explains how to use some of the controls you will use to display data like the Repeater and the DataGrid control. You will see how to insert, update, delete, and sort data. The chapter also covers working with stored procedures and XML.
Chapter 7, Work with Web Services, explains how you can create, test, and consume Web services. The chapter explains how to return a number of data types including arrays, enumerations, objects, XML, and SQL Data. You see how to create clients for the Web service, including a Web page client and a Console client. Chapter 8, Create Custom Components, explains how to create components, build a two-tier and a three-tier Web Form, and store code in Code-behind components for your ASP.NET Web pages.
Chapter 9, Using ASP.NET Components, explains how to work with components not covered in other chapters including the Browser Capabilities component and components necessary to send e-mail. Page and Data caching of your ASP.NET Web pages is covered as well.
Chapter 10, ASP.NET Applications and State Management, explains how to work with application and session state with ASP.NET. It also covers working with cookies and page state.
Chapter 11, Configure Your ASP.NET Applications, describes the process for setting and retrieving configuration information for your ASP.NET application.
Chapter 12 introduces you to debugging your ASP.NET applications.
Chapter 13, Security and ASP.NET, shows you several different ways to secure your ASP.NET applications. Chapter 14, Localization and ASP.NET, walks you through how to globalize your ASP.NET application for different cultures, locales, and languages.
The final chapter explains some of the details about migrating to ASP.NET, including migrating code from VBScript to VB.NET and other important issues to address when migrating.
The Appendices include useful tables of reference material and a summary of important elements of ASP.NET syntax and the C#, VB, and Jscript languages.
The CD-ROM in the back of this book contains the sample code from each of the two-page lessons, as well as the code from most of the Apply It sections. This saves you from having to type the code and helps you quickly get started creating ASP.NET programs. The CD-ROM also contains several shareware and evaluation versions of programs that can help you work with ASP.NET. An e-version of this book is also available on the companion disc.
RODUCTION TO ASP.NET
SP.NET is a programming framework developed by Microsoft for building powerful Web applications.
The previous version of Active Server Pages was ASP 3.0. ASP.NET and ASP 3.0 can both run on Internet Information Server (IIS) 5.0 with Windows 2000 and Windows XP. You can have your ASP.NET and your ASP 3.0 applications run on the same server.
If you use Windows 95, 98, ME, or NT, and you want to run ASP.NET applications, you can install Windows NT or XP in addition to your other operating system by creating a dual-boot machine. This will enable you to run two operating systems on one machine, giving you the ability to run ASP.NET and keeping your original operating system intact. You will have to devote around 5GB of disk space to install the operating system (OS), the .NET Framework SDK, and any other supporting applications, such as SQL Server 2000. To separate the files associated for each OS, you should create a separate partition for the new OS.
The ASP.NET Framework is supported on Windows 2000 and Windows XP. ASP.NET applications will run on IIS 5.0 for these operating systems.
Web Services is supported on all platforms supported by the Microsoft .NET Framework SDK, except Windows 95.
Windows XP, Windows 2000, Windows NT 4 with Service Pack 6a, Windows ME, Windows 98, Windows 98 SE, and Windows 95 all support the Microsoft .NET Framework SDK.
ASP.NET has built-in support for three languages: Visual Basic (VB), C#, and JScript. You can install support for other .NET-compatible languages as well.
Microsoft designed ASP.NET to work with WYSIWYG HTML editors and other programming tools. Or, you can even use a simple text editor like Notepad. The Notepad text editor is used in this book's code samples. If you want more support from your development environment for coding, you can use Microsoft Visual Studio.NET. Using a tool such as Microsoft Visual Studio.NET enables you to take advantage of other features such as GUI support of drag and drop Server Controls and debugging support.
ASP.NET Web Forms gives you the ability to create Web pages on the .NET platform. Web Forms enable you to program against the controls that you put on your Web pages. You can either use a Server Control that is built into ASP.NET or create your own custom Server Controls. These Server Controls are used for controlling HTML tags on a Web page. By using Web Forms, you can build user interface code as effectively as your Business Services code, reusing and packaging the code in a well-designed manner.
ASP.NET Web Services gives you the ability to access server functionality remotely. Using Web Services, businesses can expose their data and/or component libraries, which in turn can be obtained and manipulated by client and server applications. Web Services enable the exchange of data in client-server or server-server scenarios, using standards like HTTP and XML messaging to move data across firewalls. Web services are not tied to a particular component technology or object-calling convention. As a result, programs written in any language, using any component model, and running on any operating system can access Web services.
Was this article helpful?