Docstoc

ASPnet-Quick-Start-Tutorials-VBL

Document Sample
ASPnet-Quick-Start-Tutorials-VBL Powered By Docstoc
					Microsoft QuickStart Tutorial



                                      Quickstart Tutorials                               Hide TOC | I want my samples in...                    VB.NET

                                      Welcome | ASP.NET | WinForms | Common Tasks | LateBreaking


                                                                                                                                Add To "My Favorites"


    Getting Started
     Introduction                           Welcome to the ASP.NET QuickStart Tutorial
     What is ASP.NET?
     Language Support                       The ASP.NET QuickStart is a series of ASP.NET samples and supporting commentary designed to quickly acquaint
                                            developers with the syntax, architecture, and power of the ASP.NET Web programming framework. The QuickStart
                                            samples are designed to be short, easy-to-understand illustrations of ASP.NET features. By the time you have
    ASP.NET Web Forms                       completed the QuickStart tutorial, you will be familiar with:
     Introducing Web Forms
     Working with Server Controls                 q   ASP.NET Syntax. While some of the ASP.NET syntax elements will be familiar to veteran ASP developers,
     Applying Styles to Controls                      several are unique to the new framework. The QuickStart samples cover each element in detail.
     Server Control Form Validation               q   ASP.NET Architecture and Features. The QuickStart introduces the features of ASP.NET that enable
                                                      developers to build interactive, world-class applications with much less time and effort than ever before.
     Web Forms User Controls                      q   Best Practices. The QuickStart samples demonstrate the best ways to exercise the power of ASP.NET
     Data Binding Server Controls                     while avoiding potential pitfalls along the way.
     Server-Side Data Access
     Data Access and Customization          What Level of Expertise Is Assumed in the QuickStart?
                                            If you have never developed Web pages before, the QuickStart is not for you. You should be fluent in HTML and
     Working with Business Objects
                                            general Web development terminology. You do not need previous ASP experience, but you should be familiar with
     Authoring Custom Controls              the concepts behind interactive Web pages, including forms, scripts, and data access.
     Web Forms Controls Reference
     Web Forms Syntax Reference             Working with the QuickStart Samples
                                            The QuickStart samples are best experienced in the order in which they are presented. Each sample builds on
                                            concepts discussed in the preceding sample. The sequence begins with a simple form submittal and builds up to
    ASP.NET Web Services                    integrated application scenarios.
     Introducing Web Services
     Writing a Simple Web Service
     Web Service Type Marshalling
     Using Data in Web Services
     Using Objects and Intrinsics
     The WebService Behavior
     HTML Pattern Matching


    ASP.NET Web Applications
     Application Overview
     Using the Global.asax File
     Managing Application State
     HttpHandlers and Factories


    Cache Services
     Caching Overview
     Page Output Caching
     Page Fragment Caching
     Page Data Caching


    Configuration
     Configuration Overview
     Configuration File Format
     Retrieving Configuration


    Deployment
     Deploying Applications
     Using the Process Model
     Handling Errors


    Security
     Security Overview
     Authentication & Authorization
     Windows-based Authentication
     Forms-based Authentication
     Authorizing Users and Roles
     User Account Impersonation
     Security and WebServices


http://samples.gotdotnet.com/quickstart/aspplus/ (1 of 2) [4/02/2002 8:50:06 AM]
Microsoft QuickStart Tutorial


    Localization
     Internationalization Overview
     Setting Culture and Encoding
     Localizing ASP.NET Applications
     Working with Resource Files


    Tracing
     Tracing Overview
     Trace Logging to Page Output
     Application-level Trace Logging


    Debugging
     The SDK Debugger


    Performance
     Performance Overview
     Performance Tuning Tips
     Measuring Performance


    ASP to ASP.NET Migration
     Migration Overview
     Syntax and Semantics
     Language Compatibility
     COM Interoperability
     Transactions


    Sample Applications
     A Personalized Portal
     An E-Commerce Storefront
     A Class Browser Application
     IBuySpy.com


     Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/ (2 of 2) [4/02/2002 8:50:06 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                       Welcome to the ASP.NET QuickStart Tutorial
 Introduction
 What is ASP.NET?                                     The ASP.NET QuickStart is a series of ASP.NET samples and supporting
                                                      commentary designed to quickly acquaint developers with the syntax,
 Language Support
                                                      architecture, and power of the ASP.NET Web programming framework. The
                                                      QuickStart samples are designed to be short, easy-to-understand
ASP.NET Web Forms                                     illustrations of ASP.NET features. By the time you have completed the
                                                      QuickStart tutorial, you will be familiar with:
 Introducing Web Forms
 Working with Server Controls
                                                             q   ASP.NET Syntax. While some of the ASP.NET syntax elements
 Applying Styles to Controls                                     will be familiar to veteran ASP developers, several are unique to
 Server Control Form Validation                                  the new framework. The QuickStart samples cover each element
 Web Forms User Controls                                         in detail.
                                                             q   ASP.NET Architecture and Features. The QuickStart
 Data Binding Server Controls                                    introduces the features of ASP.NET that enable developers to
 Server-Side Data Access                                         build interactive, world-class applications with much less time and
 Data Access and Customization                                   effort than ever before.
                                                             q   Best Practices. The QuickStart samples demonstrate the best
 Working with Business Objects                                   ways to exercise the power of ASP.NET while avoiding potential
 Authoring Custom Controls                                       pitfalls along the way.
 Web Forms Controls Reference
 Web Forms Syntax Reference                           What Level of Expertise Is Assumed in the QuickStart?
                                                      If you have never developed Web pages before, the QuickStart is not for
                                                      you. You should be fluent in HTML and general Web development
ASP.NET Web Services                                  terminology. You do not need previous ASP experience, but you should be
 Introducing Web Services                             familiar with the concepts behind interactive Web pages, including forms,
                                                      scripts, and data access.
 Writing a Simple Web Service
 Web Service Type Marshalling
                                                      Working with the QuickStart Samples
 Using Data in Web Services                           The QuickStart samples are best experienced in the order in which they are
 Using Objects and Intrinsics                         presented. Each sample builds on concepts discussed in the preceding
 The WebService Behavior                              sample. The sequence begins with a simple form submittal and builds up to
                                                      integrated application scenarios.
 HTML Pattern Matching


ASP.NET Web Applications
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/default.aspx (1 of 2) [4/02/2002 8:50:08 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/default.aspx (2 of 2) [4/02/2002 8:50:08 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      What is ASP.NET?
 Introduction
 What is ASP.NET?                                    ASP.NET is a programming framework built on the common language
                                                     runtime that can be used on a server to build powerful Web applications.
 Language Support
                                                     ASP.NET offers several important advantages over previous Web
                                                     development models:
ASP.NET Web Forms
 Introducing Web Forms                                      q   Enhanced Performance. ASP.NET is compiled common
 Working with Server Controls                                   language runtime code running on the server. Unlike its
                                                                interpreted predecessors, ASP.NET can take advantage of early
 Applying Styles to Controls                                    binding, just-in-time compilation, native optimization, and caching
 Server Control Form Validation                                 services right out of the box. This amounts to dramatically better
 Web Forms User Controls                                        performance before you ever write a line of code.

 Data Binding Server Controls                               q   World-Class Tool Support. The ASP.NET framework is
 Server-Side Data Access                                        complemented by a rich toolbox and designer in the Visual Studio
                                                                integrated development environment. WYSIWYG editing, drag-and-
 Data Access and Customization
                                                                drop server controls, and automatic deployment are just a few of
 Working with Business Objects                                  the features this powerful tool provides.
 Authoring Custom Controls
                                                            q   Power and Flexibility. Because ASP.NET is based on the
 Web Forms Controls Reference                                   common language runtime, the power and flexibility of that entire
 Web Forms Syntax Reference                                     platform is available to Web application developers. The .NET
                                                                Framework class library, Messaging, and Data Access solutions are
                                                                all seamlessly accessible from the Web. ASP.NET is also language-
ASP.NET Web Services                                            independent, so you can choose the language that best applies to
 Introducing Web Services                                       your application or partition your application across many
                                                                languages. Further, common language runtime interoperability
 Writing a Simple Web Service
                                                                guarantees that your existing investment in COM-based
 Web Service Type Marshalling                                   development is preserved when migrating to ASP.NET.
 Using Data in Web Services
                                                            q   Simplicity. ASP.NET makes it easy to perform common tasks,
 Using Objects and Intrinsics                                   from simple form submission and client authentication to
 The WebService Behavior                                        deployment and site configuration. For example, the ASP.NET
 HTML Pattern Matching                                          page framework allows you to build user interfaces that cleanly
                                                                separate application logic from presentation code and to handle
                                                                events in a simple, Visual Basic - like forms processing model.
ASP.NET Web Applications                                        Additionally, the common language runtime simplifies
                                                                development, with managed code services such as automatic
 Application Overview
                                                                reference counting and garbage collection.
 Using the Global.asax File
 Managing Application State                                 q   Manageability. ASP.NET employs a text-based, hierarchical
                                                                configuration system, which simplifies applying settings to your
 HttpHandlers and Factories                                     server environment and Web applications. Because configuration
                                                                information is stored as plain text, new settings may be applied
                                                                without the aid of local administration tools. This "zero local
Cache Services                                                  administration" philosophy extends to deploying ASP.NET
 Caching Overview                                               applications as well. An ASP.NET application is deployed to a
 Page Output Caching                                            server simply by copying the necessary files to the server. No
                                                                server restart is required, even to deploy or replace running
 Page Fragment Caching
                                                                compiled code.
 Page Data Caching
                                                            q   Scalability and Availability. ASP.NET has been designed with
                                                                scalability in mind, with features specifically tailored to improve
Configuration                                                   performance in clustered and multiprocessor environments.
 Configuration Overview                                         Further, processes are closely monitored and managed by the
                                                                ASP.NET runtime, so that if one misbehaves (leaks, deadlocks), a
 Configuration File Format
                                                                new process can be created in its place, which helps keep your
 Retrieving Configuration                                       application constantly available to handle requests.

                                                            q   Customizability and Extensibility. ASP.NET delivers a well-
Deployment                                                      factored architecture that allows developers to "plug-in" their code
 Deploying Applications                                         at the appropriate level. In fact, it is possible to extend or replace
 Using the Process Model                                        any subcomponent of the ASP.NET runtime with your own custom-


http://samples.gotdotnet.com/quickstart/aspplus/doc/whatisaspx.aspx (1 of 2) [4/02/2002 8:50:09 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors                                                written component. Implementing custom authentication or state
                                                                services has never been easier.

Security                                                    q   Security. With built in Windows authentication and per-
                                                                application configuration, you can be assured that your
 Security Overview
                                                                applications are secure.
 Authentication & Authorization
 Windows-based Authentication
                                                     The remainder of the QuickStart presents practical examples of these
 Forms-based Authentication                          concepts.
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/whatisaspx.aspx (2 of 2) [4/02/2002 8:50:09 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Introducing Web Forms
 Introduction
 What is ASP.NET?                                               What is ASP.NET Web Forms?
 Language Support                                               Writing Your First Web Forms Page
                                                                Using ASP <%%> Render Blocks
ASP.NET Web Forms                                               Introduction to Server Controls
 Introducing Web Forms                                          Handling Server Control Events
 Working with Server Controls                                   Using Custom Server Controls
 Applying Styles to Controls                                    Lists, Data, and Databinding
 Server Control Form Validation                                 Form Validation Controls
 Web Forms User Controls                                        Code-Behind Web Forms
 Data Binding Server Controls                                   Section Summary
 Server-Side Data Access
 Data Access and Customization
 Working with Business Objects                       What is ASP.NET Web Forms?
 Authoring Custom Controls
 Web Forms Controls Reference                        The ASP.NET Web Forms page framework is a scalable common language
 Web Forms Syntax Reference                          runtime programming model that can be used on the server to dynamically
                                                     generate Web pages.

ASP.NET Web Services                                 Intended as a logical evolution of ASP (ASP.NET provides syntax
 Introducing Web Services                            compatibility with existing pages), the ASP.NET Web Forms framework has
 Writing a Simple Web Service                        been specifically designed to address a number of key deficiencies in the
                                                     previous model. In particular, it provides:
 Web Service Type Marshalling
 Using Data in Web Services
                                                            q   The ability to create and use reusable UI controls that can
 Using Objects and Intrinsics
                                                                encapsulate common functionality and thus reduce the amount of
 The WebService Behavior                                        code that a page developer has to write.
 HTML Pattern Matching                                      q   The ability for developers to cleanly structure their page logic in
                                                                an orderly fashion (not "spaghetti code").
                                                            q   The ability for development tools to provide strong WYSIWYG
ASP.NET Web Applications                                        design support for pages (existing ASP code is opaque to tools).
 Application Overview
 Using the Global.asax File                          This section of the QuickStart provides a high-level code walkthrough of
                                                     some key ASP.NET Web Forms features. Subsequent sections of the
 Managing Application State
                                                     QuickStart drill down into more specific details.
 HttpHandlers and Factories
                                                     Writing Your First Web Forms Page
Cache Services
 Caching Overview                                    ASP.NET Web Forms pages are text files with an .aspx file name extension.
                                                     They can be deployed throughout an IIS virtual root directory tree. When a
 Page Output Caching                                 browser client requests .aspx resources, the ASP.NET runtime parses and
 Page Fragment Caching                               compiles the target file into a .NET Framework class. This class can then be
 Page Data Caching                                   used to dynamically process incoming requests. (Note that the .aspx file is
                                                     compiled only the first time it is accessed; the compiled type instance is
                                                     then reused across multiple requests).
Configuration
 Configuration Overview                              An ASP.NET page can be created simply by taking an existing HTML file
 Configuration File Format                           and changing its file name extension to .aspx (no modification of code is
                                                     required). For example, the following sample demonstrates a simple HTML
 Retrieving Configuration
                                                     page that collects a user's name and category preference and then
                                                     performs a form postback to the originating page when a button is clicked:
Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/webformsintro.aspx (1 of 7) [4/02/2002 8:50:18 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication                                VB Intro1.aspx
 Forms-based Authentication
 Authorizing Users and Roles                                 [Run Sample] | [View Source]
 User Account Impersonation
 Security and WebServices                            Important: Note that nothing happens yet when you click the Lookup
                                                     button. This is because the .aspx file contains only static HTML (no
                                                     dynamic content). Thus, the same HTML is sent back to the client on each
Localization                                         trip to the page, which results in a loss of the contents of the form fields
 Internationalization Overview                       (the text box and drop-down list) between requests.
 Setting Culture and Encoding
                                                     Using ASP <% %> Render Blocks
 Localizing ASP.NET Applications
 Working with Resource Files
                                                     ASP.NET provides syntax compatibility with existing ASP pages. This
                                                     includes support for <% %> code render blocks that can be intermixed
Tracing                                              with HTML content within an .aspx file. These code blocks execute in a top-
                                                     down manner at page render time.
 Tracing Overview
 Trace Logging to Page Output
                                                     The below example demonstrates how <% %> render blocks can be used
 Application-level Trace Logging                     to loop over an HTML block (increasing the font size each time):


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips                                     VB Intro2.aspx
 Measuring Performance
                                                             [Run Sample] | [View Source]
ASP to ASP.NET Migration
 Migration Overview                                  Important: Unlike with ASP, the code used within the above <% %>
 Syntax and Semantics                                blocks is actually compiled--not interpreted using a script engine. This
                                                     results in improved runtime execution performance.
 Language Compatibility
 COM Interoperability
                                                     ASP.NET page developers can utilize <% %> code blocks to dynamically
 Transactions
                                                     modify HTML output much as they can today with ASP. For example, the
                                                     following sample demonstrates how <% %> code blocks can be used to
                                                     interpret results posted back from a client.
Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page
                                                             VB Intro3.aspx

                                                             [Run Sample] | [View Source]



http://samples.gotdotnet.com/quickstart/aspplus/doc/webformsintro.aspx (2 of 7) [4/02/2002 8:50:18 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                                     Important: While <% %> code blocks provide a powerful way to custom
                                                     manipulate the text output returned from an ASP.NET page, they do not
                                                     provide a clean HTML programming model. As the sample above illustrates,
                                                     developers using only <% %> code blocks must custom manage page
                                                     state between round trips and custom interpret posted values.

                                                     Introduction to ASP.NET Server Controls

                                                     In addition to (or instead of) using <% %> code blocks to program
                                                     dynamic content, ASP.NET page developers can use ASP.NET server
                                                     controls to program Web pages. Server controls are declared within an
                                                     .aspx file using custom tags or intrinsic HTML tags that contain a
                                                     runat="server" attribute value. Intrinsic HTML tags are handled by one
                                                     of the controls in the System.Web.UI.HtmlControls namespace. Any
                                                     tag that doesn't explicitly map to one of the controls is assigned the type of
                                                     System.Web.UI.HtmlControls.HtmlGenericControl.


                                                     The following sample uses four server controls: <form runat=server>,
                                                     <asp:textbox runat=server>, <asp:dropdownlist runat=server>,
                                                     and <asp:button runat=server>. At run time these server controls
                                                     automatically generate HTML content.




                                                             VB Intro4.aspx

                                                             [Run Sample] | [View Source]


                                                     Important: Note that these server controls automatically maintain any
                                                     client-entered values between round trips to the server. This control state
                                                     is not stored on the server (it is instead stored within an <input
                                                     type="hidden"> form field that is round-tripped between requests). Note
                                                     also that no client-side script is required.


                                                     In addition to supporting standard HTML input controls, ASP.NET enables
                                                     developers to utilize richer custom controls on their pages. For example,
                                                     the following sample demonstrates how the <asp:adrotator> control can
                                                     be used to dynamically display rotating ads on a page.




                                                             VB Intro5.aspx

                                                             [Run Sample] | [View Source]


                                                     Important: A detailed listing of all built-in server controls can be found in
                                                     the Web Forms Control Reference section of this QuickStart.

                                                     Handling Server Control Events

http://samples.gotdotnet.com/quickstart/aspplus/doc/webformsintro.aspx (3 of 7) [4/02/2002 8:50:18 AM]
Microsoft ASP.NET QuickStarts Tutorial



                                                     Each ASP.NET server control is capable of exposing an object model
                                                     containing properties, methods, and events. ASP.NET developers can use
                                                     this object model to cleanly modify and interact with the page.


                                                     The following example demonstrates how an ASP.NET page developer can
                                                     handle the OnClick event from the <asp:button runat=server> control
                                                     to manipulate the Text property of the <asp:label runat=server>
                                                     control.




                                                             VB Intro6.aspx

                                                             [Run Sample] | [View Source]


                                                     This simple sample is functionally equivalent to the "Intro3" sample
                                                     demonstrated earlier in this section. Note, however, how much cleaner and
                                                     easier the code is in this new server-control-based version.

                                                     Using Custom Server Controls

                                                     ASP.NET ships with 45 built-in server controls that can be used out of the
                                                     box (for details, see Web Forms Controls Reference). In addition to using
                                                     the built-in ASP.NET controls, developers also can use controls developed
                                                     by third-party vendors.


                                                     The following sample shows a simple calendar control. The Calendar
                                                     control is declared within the page using an <acme:calendar
                                                     runat=server> tag. Note that the <% Register %> directive at the
                                                     top of the page is responsible for registering the "Acme" XML tag prefix
                                                     with the "Acme" code namespace of the control implementation. The
                                                     ASP.NET page parser will then utilize this namespace to load the Calendar
                                                     control class instance at run time.




                                                             VB Intro7.aspx

                                                             [Run Sample] | [View Source]


                                                     The Calendar control in this sample has been designed to perform
                                                     "uplevel-like" processing on Internet Explorer 5.5 and "downlevel"
                                                     processing on all other browsers. This browser sniffing is nowhere near as
                                                     complex as that provided by the ASP.NET built-in server controls. For
                                                     Internet Explorer 5.5 browsers it generates DHTML output. This DHTML
                                                     output does not require round trips back to the server when doing day
                                                     selections and month navigations. For all other browsers the control


http://samples.gotdotnet.com/quickstart/aspplus/doc/webformsintro.aspx (4 of 7) [4/02/2002 8:50:18 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                                     generates standard HTML 3.2. This HTML 3.2 does require round trips back
                                                     to the server to handle client-side user interactions.


                                                     Important: The code that a page developer writes is identical regardless
                                                     of whether an "uplevel" or "downlevel" browser is used to access the page.
                                                     The Calendar control itself encapsulates all of the logic required to handle
                                                     the two scenarios.

                                                     Lists, Data, and Data Binding

                                                     ASP.NET ships with a built-in set of data grid and list controls. These can
                                                     be used to provide custom UI driven from queries against a database or
                                                     other data source. For example, the following sample demonstrates how a
                                                     <asp:datagrid runat=server> control can be used to databind book
                                                     information collected using a SQL database query.




                                                             VB Intro8.aspx

                                                             [Run Sample] | [View Source]


                                                     The <asp:datagrid runat=server> DataGrid control provides an easy
                                                     way to quickly display data results using a traditional grid-control UI.
                                                     Alternatively, ASP.NET developers can use the <asp:DataList
                                                     runat=server> DataList control and a custom ItemTemplate template
                                                     to customize data information, as in the following sample.




                                                             VB Intro9.aspx

                                                             [Run Sample] | [View Source]


                                                     Note that the <asp:datalist runat=server> control enables end users to
                                                     exactly control the structure and layout of each item within the list (using
                                                     the ItemTemplate template property). The control also automatically
                                                     handles the two-column wrapping of content (users can control the number
                                                     of columns using the RepeatColumns property on the data list).


                                                     The following sample provides an alternate view of the <asp:datalist
                                                     runat=server> control.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webformsintro.aspx (5 of 7) [4/02/2002 8:50:18 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                             VB Intro10.aspx

                                                             [Run Sample] | [View Source]


                                                     Note that the control, data model, and page user in this example are
                                                     exactly the same as those in the previous sample. The only difference is
                                                     that, here, alternative templates are declaratively supplied to the code.

                                                     Form Validation Controls

                                                     The ASP.NET Web Forms page framework provides a set of validation
                                                     server controls that provide an easy-to-use but powerful way to check
                                                     input forms for errors, and, if necessary, display messages to the user.


                                                     Validation controls are added to an ASP.NET page like other server
                                                     controls. There are controls for specific types of validation, such as range
                                                     checking or pattern matching, plus a RequiredFieldValidator that
                                                     ensures that a user does not skip an entry field.


                                                     The following example demonstrates how to use two
                                                     <asp:requiredfieldvalidator runat=server> controls on a page to
                                                     validate the contents of the TextBox and DropDownList controls.




                                                             VB Intro11.aspx

                                                             [Run Sample] | [View Source]


                                                     Note that the validation controls have both uplevel and downlevel client
                                                     support. Uplevel browsers perform validation on the client (using JavaScript
                                                     and DHTML) and on the server. Downlevel browsers perform the validation
                                                     only on the server. The programming model for the two scenarios is
                                                     identical.


                                                     Note that ASP.NET page developers can optionally check the Page.IsValid
                                                     property at run time to determine whether all validation server controls on
                                                     a page are currently valid. This provides a simple way to determine
                                                     whether or not to proceed with business logic. For example, the following
                                                     sample performs a Page.IsValid check before executing a database
                                                     lookup on the specified category.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webformsintro.aspx (6 of 7) [4/02/2002 8:50:18 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                             VB Intro12.aspx

                                                             [Run Sample] | [View Source]


                                                     Code-Behind Web Forms

                                                     ASP.NET supports two methods of authoring dynamic pages. The first is
                                                     the method shown in the preceding samples, where the page code is
                                                     physically declared within the originating .aspx file. An alternative approach-
                                                     -known as the code-behind method--enables the page code to be more
                                                     cleanly separated from the HTML content into an entirely separate file.


                                                     The following sample demonstrates the use of the code-behind method of
                                                     writing ASP.NET page code.




                                                             VB Intro13.aspx

                                                             [Run Sample] | [View Source]


                                                     Section Summary

                                                           1. ASP.NET Web Forms provide an easy and powerful way to build
                                                              dynamic Web UI.
                                                           2. ASP.NET Web Forms pages can target any browser client (there
                                                              are no script library or cookie requirements).
                                                           3. ASP.NET Web Forms pages provide syntax compatibility with
                                                              existing ASP pages.
                                                           4. ASP.NET server controls provide an easy way to encapsulate
                                                              common functionality.
                                                           5. ASP.NET ships with 45 built-in server controls. Developers can
                                                              also use controls built by third parties.
                                                           6. ASP.NET server controls can automatically project both uplevel
                                                              and downlevel HTML.
                                                           7. ASP.NET templates provide an easy way to customize the look and
                                                              feel of list server controls.
                                                           8. ASP.NET validation controls provide an easy way to do declarative
                                                              client or server data validation.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webformsintro.aspx (7 of 7) [4/02/2002 8:50:18 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Working with Server Controls
 Introduction
 What is ASP.NET?                                             Declaring Server Controls
 Language Support                                             Manipulating Server Controls
                                                              Handling Control Action Events
ASP.NET Web Forms                                             Handling Multiple Control Action Events
 Introducing Web Forms                                        Performing Page Navigation (Scenario 1)
 Working with Server Controls                                 Performing Page Navigation (Scenario 2)
 Applying Styles to Controls
 Server Control Form Validation
 Web Forms User Controls                             This section of the QuickStart illustrates some common core concepts and
 Data Binding Server Controls                        common actions performed by end users when using ASP.NET server
                                                     controls within a page.
 Server-Side Data Access
 Data Access and Customization                       Declaring Server Controls
 Working with Business Objects
 Authoring Custom Controls                           ASP.NET server controls are identified within a page using declarative tags
                                                     that contain a runat="server" attribute. The following example declares
 Web Forms Controls Reference
                                                     three <asp:label runat="server"> server controls and customizes the
 Web Forms Syntax Reference                          text and style properties of each one individually.


ASP.NET Web Services
 Introducing Web Services
 Writing a Simple Web Service
 Web Service Type Marshalling
 Using Data in Web Services
 Using Objects and Intrinsics                                 VB Controls1.aspx
 The WebService Behavior
 HTML Pattern Matching                                       [Run Sample] | [View Source]

ASP.NET Web Applications                             Manipulating Server Controls
 Application Overview
 Using the Global.asax File
                                                     You can programmatically identify an individual ASP.NET server control
 Managing Application State                          within a page by providing it with an id attribute. You can use this id
 HttpHandlers and Factories                          reference to programmatically manipulate the server control's object model
                                                     at run time. For example, the following sample demonstrates how a page
                                                     developer could programmatically set an <asp:label runat="server">
Cache Services                                       control's Text property within the Page_Load event.
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview                                       VB Controls2.aspx
 Configuration File Format
 Retrieving Configuration                                    [Run Sample] | [View Source]


Deployment                                           Handling Control Action Events
 Deploying Applications
 Using the Process Model                             ASP.NET server controls can optionally expose and raise server events,


http://samples.gotdotnet.com/quickstart/aspplus/doc/webserverctrls.aspx (1 of 3) [4/02/2002 8:50:22 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors                                     which can be handled by page developers. A page developer may
                                                     accomplish this by declaratively wiring an event to a control (where the
                                                     attribute name of an event wireup indicates the event name and the
Security                                             attribute value indicates the name of a method to call). For example, the
 Security Overview                                   following code example demonstrates how to wire an OnClick event to a
                                                     button control.
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices

                                                              VB Controls3.aspx
Localization
 Internationalization Overview
                                                             [Run Sample] | [View Source]
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files                         Handling Multiple Control Action Events

                                                     Event handlers provide a clean way for page developers to structure logic
Tracing                                              within an ASP.NET page. For example, the following sample demonstrates
 Tracing Overview                                    how to wire and handle four button events on a single page.
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance                                                   VB Controls4.aspx
 Performance Overview
 Performance Tuning Tips                                     [Run Sample] | [View Source]
 Measuring Performance

                                                     Performing Page Navigation (Scenario 1)
ASP to ASP.NET Migration
 Migration Overview                                  Page navigation among multiple pages is a common scenario in virtually all
 Syntax and Semantics                                Web applications. The following sample demonstrates how to use the
 Language Compatibility                              <asp:hyperlink runat=server> control to navigate to another page
                                                     (passing custom query string parameters along the way). The sample then
 COM Interoperability                                demonstrates how to easily get access to these query string parameters
 Transactions                                        from the target page.


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com
                                                              VB Controls5.aspx
 Get URL for this page
                                                             [Run Sample] | [View Source]


                                                     Performing Page Navigation (Scenario 2)


http://samples.gotdotnet.com/quickstart/aspplus/doc/webserverctrls.aspx (2 of 3) [4/02/2002 8:50:22 AM]
Microsoft ASP.NET QuickStarts Tutorial


                                                     Not all page navigation scenarios are initiated through hyperlinks on the
                                                     client. Client-side page redirects or navigations can also be initiated from
                                                     the server by an ASP.NET page developer by calling the
                                                     Page.Navigate(url) method. This is typically done when server-side
                                                     validation is required on some client input before the navigation actually
                                                     takes place.


                                                     The following sample demonstrates how to use the Page.Navigate
                                                     method to pass parameters to another target page. It also demonstrates
                                                     how to easily get access to these parameters from the target page.




                                                              VB Controls6.aspx

                                                             [Run Sample] | [View Source]




http://samples.gotdotnet.com/quickstart/aspplus/doc/webserverctrls.aspx (3 of 3) [4/02/2002 8:50:22 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Applying Styles to Controls
 Introduction
 What is ASP.NET?                                 Applying Styles to HTMLControls
 Language Support                                 Applying Styles to Web Controls
                                                  Section Summary
ASP.NET Web Forms
 Introducing Web Forms
 Working with Server Controls             The Web is a flexible environment for user interfaces, with extreme variations in the look and feel of
 Applying Styles to Controls              different Web sites. The widespread adoption of cascading style sheets (CSS) is largely responsible for the
                                          rich designs encountered on the Web. All of ASP.NET's HTML server controls and Web server controls have
 Server Control Form Validation           been designed to provide first-class support for CSS styles. This section discusses how to use styles in
 Web Forms User Controls                  conjunction with server controls and demonstrates the very fine control over the look and feel of your Web
 Data Binding Server Controls             Forms that they provide.

 Server-Side Data Access                  Applying Styles to HTML Controls
 Data Access and Customization
 Working with Business Objects            Standard HTML tags support CSS through a style attribute, which can be set to a semicolon-delimited list of
 Authoring Custom Controls                attribute/value pairs. For more information about the CSS attributes supported by the Internet Explorer
                                          browser, see MSDN Web Workshop's CSS Attributes Reference page. All of the ASP.NET HTML server
 Web Forms Controls Reference
                                          controls can accept styles in exactly the same manner as standard HTML tags. The following example
 Web Forms Syntax Reference               illustrates a number of styles applied to various HTML server controls. If you view the source code on the
                                          page returned to the client, you will see that these styles are passed along to the browser in the control's
                                          rendering.
ASP.NET Web Services
 Introducing Web Services
 Writing a Simple Web Service
 Web Service Type Marshalling
 Using Data in Web Services
 Using Objects and Intrinsics
 The WebService Behavior
 HTML Pattern Matching                            VB Style1.aspx

                                                 [Run Sample] | [View Source]
ASP.NET Web Applications
 Application Overview
 Using the Global.asax File               CSS also defines a class attribute, which can be set to a CSS style definition contained in a
                                          <style>...</style> section of the document. The class attribute makes it easy to define styles once and
 Managing Application State               apply them to several tags without having to redefine the style itself. Styles on HTML server controls also
 HttpHandlers and Factories               can be set in this manner, as demonstrated in the following sample.


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching
                                                  VB Style2.aspx
Configuration
 Configuration Overview                          [Run Sample] | [View Source]
 Configuration File Format
 Retrieving Configuration                 When an ASP.NET page is parsed, the style information is populated into a Style property (of type
                                          CssStyleCollection) on the System.Web.UI.HtmlControls.HtmlControl class. This property is
                                          essentially a dictionary that exposes the control's styles as a string-indexed collection of values for each
Deployment                                style-attribute key. For example, you could use the following code to set and subsequently retrieve the
 Deploying Applications                   width style attribute on an HtmlInputText server control.
 Using the Process Model
 Handling Errors
                                               <script language="VB" runat="server" >

Security                                             Sub Page_Load(Sender As Object, E As EventArgs)
                                                         MyText.Style("width") = "90px"
 Security Overview                                       Response.Write(MyText.Style("width"))
 Authentication & Authorization                      End Sub
 Windows-based Authentication
                                               </script>
 Forms-based Authentication
 Authorizing Users and Roles                   <input type="text" id="MyText" runat="server"/>

 User Account Impersonation
 Security and WebServices                 VB



 http://samples.gotdotnet.com/quickstart/aspplus/doc/webtemplates.aspx (1 of 4) [4/02/2002 8:50:25 AM]
 Microsoft ASP.NET QuickStarts Tutorial


                                          This next sample shows how you can programmatically manipulate the style for an HTML server control
Localization                              using this Style collection property.
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
                                                  VB Style3.aspx
 Trace Logging to Page Output
 Application-level Trace Logging                 [Run Sample] | [View Source]

Debugging
                                          Applying Styles to Web Server Controls
 The SDK Debugger

                                          Web server controls provide an additional level of support for styles by adding several strongly typed
Performance                               properties for commonly used style settings, such as background and foreground color, font name and size,
 Performance Overview                     width, height, and so on. These style properties represent a subset of the style behaviors available in HTML
                                          and are represented as "flat" properties exposed directly on the
 Performance Tuning Tips
                                          System.Web.UI.WebControls.WebControl base class. The advantage of using these properties is that
 Measuring Performance                    they provide compile-time type checking and statement completion in development tools such as Microsoft
                                          Visual Studio.NET.

ASP to ASP.NET Migration
 Migration Overview                       The following sample shows a WebCalendar control with several styles applied to it (a calendar without
                                          styles applied is included for contrast). Note that when setting a property that is a class type, such as Font,
 Syntax and Semantics                     you need to use the subproperty syntax PropertyName-SubPropertyName .
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront                         VB Style4.aspx
 A Class Browser Application
 IBuySpy.com                                     [Run Sample] | [View Source]

 Get URL for this page                    The System.Web.UI.WebControls namespace includes a Style base class that encapsulates common
                                          style attributes (additional style classes, such as TableStyle and TableItemStyle, inherit from this
                                          common base class). Many Web server controls expose properties of this type for specifying the style of
                                          individual rendering elements of the control. For example, the WebCalendar exposes many such style
                                          properties: DayStyle, WeekendDayStyle, TodayDayStyle, SelectedDayStyle,
                                          OtherMonthDayStyle, and NextPrevStyle. You can set individual properties of these styles using the
                                          subproperty syntax PropertyName-SubPropertyName, as the following sample demonstrates.




                                                  VB Style5.aspx

                                                 [Run Sample] | [View Source]


                                          A slightly different syntax allows each Style property to be declared as a child element nested within Web
                                          server control tags.


                                               <ASP:Calendar ... runat="server">
                                                   <TitleStyle BorderColor="darkolivegreen" BorderWidth="3"
                                                           BackColor="olivedrab" Height="50px" />
                                               </ASP:Calendar>


                                          The following sample shows alternative syntax but is functionally equivalent to the preceding one.




 http://samples.gotdotnet.com/quickstart/aspplus/doc/webtemplates.aspx (2 of 4) [4/02/2002 8:50:25 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                 VB Style6.aspx

                                                [Run Sample] | [View Source]


                                         As with HTML server controls, you can apply styles to Web server controls using a CSS class definition. The
                                         WebControl base class exposes a String property named CssClass for setting the style class:




                                                 VB Style7.aspx

                                                [Run Sample] | [View Source]


                                         If an attribute is set on a server control that does not correspond to any strongly typed property on the
                                         control, the attribute and value are populated in the Attributes collection of the control. By default, server
                                         controls will render these attributes unmodified in the HTML returned to the requesting browser client. This
                                         means that the style and class attributes can be set on Web server controls directly instead of using the
                                         strongly typed properties. While this requires some understanding of the actual rendering of the control, it
                                         can be a flexible way to apply styles as well. It is especially useful for the standard form input controls, as
                                         illustrated in the following sample.




                                                 VB Style8.aspx

                                                [Run Sample] | [View Source]


                                         Web server control styles can also be set programmatically, using the ApplyStyle method of the base
                                         WebControl class, as in the following code.



                                              <script language="VB" runat="server">
                                                  Sub Page_Load(Src As Object, E As EventArgs)
                                                      Dim MyStyle As New Style
                                                      MyStyle.BorderColor = Color.Black
                                                      MyStyle.BorderStyle = BorderStyle.Dashed
                                                      MyStyle.BorderWidth = New Unit(1)

                                                      MyLogin.ApplyStyle (MyStyle)
                                                      MyPassword.ApplyStyle (MyStyle)
                                                      MySubmit.ApplyStyle (MyStyle)
                                                  End Sub
                                              </script>

                                              Login: <ASP:TextBox id="MyLogin" runat="server" />/<p/>
                                              Password: <ASP:TextBox id="MyPassword" TextMode="Password" runat="server" />
                                              View: <ASP:DropDownList id="MySelect" runat="server"> ... </ASP:DropDownList>


                                         VB


                                         The following sample demonstrates the code above.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webtemplates.aspx (3 of 4) [4/02/2002 8:50:25 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                              VB Style9.aspx

                                             [Run Sample] | [View Source]


                                         Section Summary

                                            1. ASP.NET's HTML server control and Web server control families provide first-class support for CSS
                                               styles.
                                            2. Styles may be applied by setting either the style or the class attributes of a control. These settings
                                               are accessible programmatically through the control's Attributes collection. In the case of HTML
                                               server controls, individual values for style-attribute keys can be retrieved from the control's Style
                                               collection.
                                            3. Most commonly used style settings are exposed on Web server controls as strongly typed
                                               properties of the control itself.
                                            4. The System.Web.UI.WebControls namespace includes a Style base class that encapsulates
                                               common style attributes. Many Web server controls expose properties of this type to control
                                               individual rendering elements.
                                            5. Styles may be set programmatically on Web server controls using the ApplyStyle method of the
                                               WebControl base class.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webtemplates.aspx (4 of 4) [4/02/2002 8:50:25 AM]
Microsoft ASP.NET QuickStarts Tutorial

    Getting Started                                Server Control Form Validation
      Introduction
      What is ASP.NET?                                      Introduction to Validation
      Language Support                                      Types of Validation Controls
                                                            Client-Side Validation
    ASP.NET Web Forms                                       Displaying Validation Errors
      Introducing Web Forms                                 Working with CompareValidator
      Working with Server Controls                          Working with RangeValidator
      Applying Styles to Controls                           Working with Regular Expressions
      Server Control Form Validation                        Performing Custom Validation
      Web Forms User Controls                               Bringing It All Together
      Data Binding Server Controls                          Section Summary
      Server-Side Data Access
      Data Access and Customization
      Working with Business Objects                Introduction to Validation
      Authoring Custom Controls
      Web Forms Controls Reference                 The Web Forms framework includes a set of validation server controls that provide an easy-to-use but powerful way to check input forms for errors and, if
      Web Forms Syntax Reference                   necessary, display messages to the user.


                                                   Validation controls are added to a Web Forms page like other server controls. There are controls for specific types of validation, such as range checking or
    ASP.NET Web Services                           pattern matching, plus a RequiredFieldValidator that ensures that a user does not skip an entry field. You can attach more than one validation control to
      Introducing Web Services                     an input control. For example, you might specify both that an entry is required and that it must contain a specific range of values.
      Writing a Simple Web Service
      Web Service Type Marshalling                 Validation controls work with a limited subset of HTML and Web server controls. For each control, a specific property contains the value to be validated. The
      Using Data in Web Services                   following table lists the input controls that may be validated.
      Using Objects and Intrinsics
      The WebService Behavior                             Control                                      Validation Property
      HTML Pattern Matching
                                                          HtmlInputText                                Value
                                                          HtmlTextArea                                 Value
    ASP.NET Web Applications
      Application Overview                                HtmlSelect                                   Value

      Using the Global.asax File                          HtmlInputFile                                Value
      Managing Application State                          TextBox                                      Text
      HttpHandlers and Factories
                                                          ListBox                                      SelectedItem.Value
                                                          DropDownList                                 SelectedItem.Value
    Cache Services
      Caching Overview                                    RadioButtonList                              SelectedItem.Value
      Page Output Caching
      Page Fragment Caching                        Types of Validation Controls
      Page Data Caching

                                              The simplest form of validation is a required field. If the user enters any value in a field, it is valid. If all of the fields in the page are valid, the page is valid.
http://samples.gotdotnet.com/quickstart/aspplus/doc/webvalidation.aspx (1 of 8) [4/02/2002 8:50:30 AM]
Microsoft ASP.NET QuickStarts Tutorial
   Configuration                             The following example illustrates this using the RequiredFieldValidator.
     Configuration Overview
     Configuration File Format
     Retrieving Configuration


   Deployment
     Deploying Applications
     Using the Process Model                         VB Validator1.aspx
     Handling Errors
                                                    [Run Sample] | [View Source]
   Security
     Security Overview                       There are also validation controls for specific types of validation, such as range checking or pattern matching. The following table lists the validation controls.
     Authentication & Authorization
     Windows-based Authentication                   Control Name                          Description
     Forms-based Authentication
                                                    RequiredFieldValidator                Ensures that the user does not skip an entry.
     Authorizing Users and Roles
                                                    CompareValidator                      Compares a user's entry with a constant value or a property value of
     User Account Impersonation
                                                                                          another control using a comparison operator (less than, equal to,
     Security and WebServices                                                             greater than, and so on).
                                                    RangeValidator                        Checks that a user's entry is between specified lower and upper
   Localization                                                                           boundaries. You can check ranges within pairs of numbers, alphabetic
     Internationalization Overview                                                        characters, or dates. Boundaries can be expressed as constants.
     Setting Culture and Encoding                   RegularExpressionValidator Checks that the entry matches a pattern defined by a regular
     Localizing ASP.NET Applications                                           expression. This type of validation allows you to check for predictable
                                                                               sequences of characters, such as those in social security numbers, e-
     Working with Resource Files
                                                                               mail addresses, telephone numbers, postal codes, and so on.
                                                    CustomValidator                       Checks the user's entry using validation logic that you code yourself.
   Tracing                                                                                This type of validation allows you to check for values derived at run
     Tracing Overview                                                                     time.
     Trace Logging to Page Output                   ValidationSummary                     Displays the validation errors in summary form for all of the validators
     Application-level Trace Logging                                                      on a page.


   Debugging                                 Client-Side Validation
     The SDK Debugger

                                             The validation controls always perform validation checking in server code. However, if the user is working with a browser that supports DHTML, the validation
   Performance                               controls can also perform validation using client script. With client-side validation, any errors are detected on the client when the form is submitted to the
     Performance Overview                    server. If any of the validators are found to be in error, the submission of the form to the server is cancelled and the validator's Text property is displayed.
                                             This permits the user to correct the input before submitting the form to the server. Field values are revalidated as soon as the field containing the error loses
     Performance Tuning Tips                 focus, thus providing the user with a rich, interactive validation experience.
     Measuring Performance
                                             Note that the Web Forms page framework always performs validation on the server, even if the validation has already been performed on the client. This
   ASP to ASP.NET Migration                  helps prevent users from being able to bypass validation by impersonating another user or a preapproved transaction.
       Migration Overview
http://samples.gotdotnet.com/quickstart/aspplus/doc/webvalidation.aspx (2 of 8) [4/02/2002 8:50:30 AM]
Microsoft ASP.NET QuickStarts Tutorial
     Syntax and Semantics                    Client-side validation is enabled by default. If the client is capable, uplevel validation will be performed automatically. To disable client-side validation, set the
                                             page's ClientTarget property to "Downlevel" ("Uplevel" forces client-side validation).
     Language Compatibility
     COM Interoperability
     Transactions


   Sample Applications
     A Personalized Portal
     An E-Commerce Storefront
                                                     VB Validator2.aspx
     A Class Browser Application
     IBuySpy.com
                                                    [Run Sample] | [View Source]

     Get URL for this page
                                             Displaying Validation Errors

                                             When the user's input is processed (for example, when the form is submitted), the Web Forms page framework passes the user's entry to the associated
                                             validation control or controls. The validation controls test the user's input and set a property to indicate whether the entry passed the validation test. After all
                                             validation controls have been processed, the IsValid property on the page is set; if any of the controls shows that a validation check failed, the entire page is
                                             set to invalid.


                                             If a validation control is in error, an error message may be displayed in the page by that validation control or in a ValidationSummary control elsewhere on
                                             the page. The ValidationSummary control is displayed when the IsValid property of the page is false. It polls each of the validation controls on the page
                                             and aggregates the text messages exposed by each. The following example illustrates displaying errors with a ValidationSummary control.




                                                     VB Validator3.aspx

                                                    [Run Sample] | [View Source]


                                             Working with CompareValidator

                                             The CompareValidator server control compares the values of two controls. CompareValidator uses three key properties to perform its validation.
                                             ControlToValidate and ControlToCompare contain the values to compare. Operator defines the type of comparison to perform--for example, Equal or
                                             Not Equal. CompareValidator performs the validation by evaluating these properties as an expression, as follows:


                                                 ( ControlToValidate <Operator> ControlToCompare )

                                             If the expression evaluates true, the validation result is valid.



http://samples.gotdotnet.com/quickstart/aspplus/doc/webvalidation.aspx (3 of 8) [4/02/2002 8:50:30 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                             The following sample shows how to use the CompareValidator control.




                                                     VB Validator4.aspx

                                                    [Run Sample] | [View Source]




                                             Working with RangeValidator


                                             The RangeValidator server control tests whether an input value falls within a given range.
                                             RangeValidator uses three key properties to perform its validation. ControlToValidate contains the value
                                             to validate. MinimumValue and MaximumValue define the minimum and maximum values of the valid
                                             range.




                                             This sample shows how to use the RangeValidator control.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webvalidation.aspx (4 of 8) [4/02/2002 8:50:30 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                     VB Validator5.aspx

                                                    [Run Sample] | [View Source]




                                             Working with Regular Expressions


                                             The RegularExpressionValidator server control checks that the entry matches a pattern defined by a
                                             regular expression. This type of validation allows you to check for predictable sequences of characters,
                                             such as those in social security numbers, e-mail addresses, telephone numbers, postal codes, and so on.




                                             RegularExpressionValidator uses two key properties to perform its validation. ControlToValidate contains
                                             the value to validate. ValidationExpression contains the regular expression to match.




                                             These samples illustrates using the RegularExpressionValidator control.




                                                     VB Validator6.aspx

                                                    [Run Sample] | [View Source]


http://samples.gotdotnet.com/quickstart/aspplus/doc/webvalidation.aspx (5 of 8) [4/02/2002 8:50:30 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                     VB Validator7.aspx

                                                    [Run Sample] | [View Source]




                                             Performing Custom Validation


                                             The CustomValidator server control calls a user-defined function to perform validations that the standard
                                             validators can't handle. The custom function can execute on the server or in client-side script, such as JScript or
                                             VBScript.
                                             For client-side custom validation, the name of the custom function must be identified in the ClientValidationFunction
                                             property. The custom function must have the form


                                                function myvalidator(source, arguments)
                                             Note that source is the client-side CustomValidator object, and arguments is an object with two properties,
                                             Value and IsValid. The Value property is the value to be validated and the IsValid property is a
                                             Boolean used to set the return result of the validation.




                                             For server-side custom validation, place your custom validation in the validator's OnServerValidate
                                             delegate.




                                             The following sample shows how to use the CustomValidator control.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webvalidation.aspx (6 of 8) [4/02/2002 8:50:30 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                     VB Validator8.aspx

                                                    [Run Sample] | [View Source]




                                             Bringing It All Together


                                             This sample shows a typical registration form, using the variations of validation controls discussed in this topic.




                                                     VB Validator9.aspx

                                                    [Run Sample] | [View Source]




http://samples.gotdotnet.com/quickstart/aspplus/doc/webvalidation.aspx (7 of 8) [4/02/2002 8:50:30 AM]
Microsoft ASP.NET QuickStarts Tutorial
                                             Section Summary




                                                 1.   Validator controls can be used to validate input on any Web Forms page.
                                                 2.   More than one control can be used on a given input field.
                                                 3.   Client-side validation may be used in addition to server validation to improve form usability.
                                                 4.   The CustomValidator control lets the user define custom validation criteria.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webvalidation.aspx (8 of 8) [4/02/2002 8:50:30 AM]
Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Web Forms User Controls
 Introduction
 What is ASP.NET?                                 Introduction to User Controls
 Language Support                                 Exposing User Control Properties
                                                  Encapsulating Events in a User Control
ASP.NET Web Forms                                 Creating User Controls Programmatically
 Introducing Web Forms                            Section Summary
 Working with Server Controls
 Applying Styles to Controls
 Server Control Form Validation           Introduction to User Controls
 Web Forms User Controls
 Data Binding Server Controls             In addition to the built-in server controls provided by ASP.NET, you can easily define your own
 Server-Side Data Access                  controls using the same programming techniques that you have already learned for writing
                                          Web Forms pages. In fact, with just a few modifications, almost any Web Forms page can be
 Data Access and Customization            reused in another page as a server control (note that a user control is of type
 Working with Business Objects            System.Web.UI.UserControl, which inherits directly from System.Web.UI.Control). A
 Authoring Custom Controls                Web Forms page used as a server control is named a user control for short. As a matter of
                                          convention, the .ascx extension is used to indicate such controls. This ensures that the user
 Web Forms Controls Reference             control's file cannot be executed as a standalone Web Forms page (you will see a little that
 Web Forms Syntax Reference               there are a few, albeit important, differences between a user control and a Web Forms page).
                                          User controls are included in a Web Forms page using a Register directive:

ASP.NET Web Services
                                               <%@ Register TagPrefix="Acme" TagName="Message" Src="pagelet1.ascx" %>
 Introducing Web Services
 Writing a Simple Web Service
                                          The TagPrefix determines a unique namespace for the user control (so that multiple user
 Web Service Type Marshalling
                                          controls with the same name can be differentiated from each other). The TagName is the
 Using Data in Web Services               unique name for the user control (you can choose any name). The Src attribute is the virtual
 Using Objects and Intrinsics             path to the user control--for example "MyPagelet.ascx" or "/MyApp/Include/MyPagelet.ascx".
                                          After registering the user control, you may place the user control tag in the Web Forms page
 The WebService Behavior
                                          just as you would an ordinary server control (including the runat="server" attribute):
 HTML Pattern Matching
                                               <Acme:Message runat="server"/>
ASP.NET Web Applications
 Application Overview                     The following example shows a user control imported into another Web Forms page. Note that
 Using the Global.asax File               the user control in this case is just a simple static file.
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching                           VB Pagelet1.aspx
 Page Data Caching
                                                 [Run Sample] | [View Source]

Configuration
 Configuration Overview                   Exposing User Control Properties
 Configuration File Format
 Retrieving Configuration                 When a Web Forms page is treated as a control, the public fields and methods of that Web
                                          Form are promoted to public properties (that is, tag attributes) and methods of the control as
                                          well. The following example shows an extension of the previous user control example that
Deployment                                adds two public String fields. Notice that these fields can be set either declaratively or
 Deploying Applications                   programmatically in the containing page.
 Using the Process Model
 Handling Errors


Security
 Security Overview
 Authentication & Authorization


http://samples.gotdotnet.com/quickstart/aspplus/doc/webpagelets.aspx (1 of 4) [4/02/2002 8:50:33 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices
                                                   VB Pagelet2.aspx
Localization
 Internationalization Overview                    [Run Sample] | [View Source]
 Setting Culture and Encoding
 Localizing ASP.NET Applications           In addition to promoting public fields to control properties, the property syntax may be used.
 Working with Resource Files               Property syntax has the advantage of being able to execute code when properties are set or
                                           retrieved. The following example demonstrates an Address user control that wraps the text
                                           properties of TextBox controls within it. The benefit of doing this is that the control inherits
Tracing                                    the automatic state management of the TextBox control for free.
 Tracing Overview
 Trace Logging to Page Output              Notice that there are two Address user controls on the containing Web Forms page that set
                                           the Caption property to "Billing Address" and "Shipping Address", respectively. The real
 Application-level Trace Logging
                                           power of user controls is in this type of reusability.

Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips                           VB Pagelet3.aspx
 Measuring Performance
                                                  [Run Sample] | [View Source]
ASP to ASP.NET Migration
 Migration Overview                        Another useful user control is a Login control for collecting user names and passwords.
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
                                                   VB Pagelet4.aspx
 An E-Commerce Storefront
 A Class Browser Application                      [Run Sample] | [View Source]
 IBuySpy.com

                                           In this example, form validation controls are added to the Login user control.
 Get URL for this page




                                                   VB Pagelet5.aspx

                                                  [Run Sample] | [View Source]


                                           Encapsulating Events in a User Control

                                           User controls participate in the complete execution lifecycle of the request, much the way
                                           ordinary server controls do. This means that a user control can handle its own events,
                                           encapsulating some of the page logic from the containing Web Forms page. The following


 http://samples.gotdotnet.com/quickstart/aspplus/doc/webpagelets.aspx (2 of 4) [4/02/2002 8:50:33 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                          example demonstrates a product-listing user control that internally handles its own postbacks.
                                          Note that the user control itself has no wrapping <form runat="server"> control. Because
                                          only one form control may be present on a page (ASP.NET does not allow nested server
                                          forms), it is left to the containing Web Forms page to define this.




                                                  VB Pagelet6.aspx

                                                 [Run Sample] | [View Source]


                                          Creating User Controls Programmatically

                                          Just as ordinary server controls can be created programmatically, so user controls can be. The
                                          page's LoadControl method is used to load the user control, passing the virtual path to the
                                          user control's source file:



                                               Dim c1 As Control = LoadControl("pagelet7.ascx")
                                               CType(c1, (Pagelet7VB)).Category = "business"
                                               Page.Controls.Add(c1)


                                          VB


                                          The type of the user control is determined by a ClassName attribute on the Control
                                          directive. For example, a user control saved with the file name "pagelet7.ascx" is assigned the
                                          strong type "Pagelet7CS" as follows:


                                               <%@ Control ClassName="Pagelet7CS" %>


                                          Because the LoadControl method returns a type of System.Web.UI.Control, it must be
                                          cast to the appropriate strong type in order to set individual properties of the control. Finally,
                                          the user control is added to the base page's ControlCollection.




                                                  VB Pagelet7.aspx

                                                 [Run Sample] | [View Source]


                                          Important The strong type for a user control is available to the containing Web Forms page
                                          only if a Register directive is included for the user control (even if there are no user control
                                          tags actually declared).


                                          Section Summary

                                                1. User controls allow developers to easily define custom controls using the same
                                                   programming techniques as for writing Web Forms pages.
                                                2. As a matter of convention, an .ascx file name extension is used to indicate such
                                                   controls. This ensures that a user control file cannot be executed as a standalone
                                                   Web Forms page.
                                                3. User controls are included into another Web Forms page using a Register directive,



http://samples.gotdotnet.com/quickstart/aspplus/doc/webpagelets.aspx (3 of 4) [4/02/2002 8:50:33 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                                  which specifies a TagPrefix, TagName, and Src location.
                                               4. After the user control has been registered, a user control tag may be placed in a Web
                                                  Forms page as an ordinary server control (including the runat="server" attribute).
                                               5. The public fields, properties, and methods of a user control are promoted to public
                                                  properties (tag attributes) and methods of the control in the containing Web Forms
                                                  page.
                                               6. User controls participate in the complete execution lifecycle of every request and can
                                                  handle their own events, encapsulating some of the page logic from the containing
                                                  Web Forms page.
                                               7. User controls should not contain any form controls but should instead rely on their
                                                  containing Web Forms page to include one if necessary.
                                               8. User controls may be created programmatically using the LoadControl method of
                                                  the System.Web.UI.Page class. The type of the user control is determined by the
                                                  ASP.NET runtime, following the convention filename_extension.
                                               9. The strong type for a user control is available to the containing Web Forms page only
                                                  if a Register directive is included for the user control (even if there are no user
                                                  control tags actually declared).




http://samples.gotdotnet.com/quickstart/aspplus/doc/webpagelets.aspx (4 of 4) [4/02/2002 8:50:33 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Data Binding Server Controls
 Introduction
 What is ASP.NET?                                  Data Binding Overview and Syntax
 Language Support                                  Binding to Simple Properties
                                                   Binding to Collections & Lists
ASP.NET Web Forms                                  Binding Expressions or Methods
 Introducing Web Forms                             DataBinder.Eval()
 Working with Server Controls                      Section Summary
 Applying Styles to Controls
 Server Control Form Validation
 Web Forms User Controls                  Data Binding Overview and Syntax
 Data Binding Server Controls
 Server-Side Data Access                  ASP.NET introduces a new declarative data binding syntax. This extremely flexible syntax
 Data Access and Customization            permits the developer to bind not only to data sources, but also to simple properties,
                                          collections, expressions, and even results returned from method calls. The following table shows
 Working with Business Objects            some examples of the new syntax.
 Authoring Custom Controls
 Web Forms Controls Reference
                                                 Simple property Customer: <%# custID %>
 Web Forms Syntax Reference
                                                 Collection           Orders: <asp:ListBox id="List1" datasource='<%#
                                                                      myArray %>' runat="server">
ASP.NET Web Services
 Introducing Web Services                        Expression           Contact: <%# ( customer.First Name + " " +
                                                                      customer.LastName ) %>
 Writing a Simple Web Service
 Web Service Type Marshalling                    Method result        Outstanding Balance: <%# GetBalance(custID) %>

 Using Data in Web Services
 Using Objects and Intrinsics             Although this syntax looks similar to the ASP shortcut for Response.Write -- <%= %> -- its
 The WebService Behavior                  behavior is quite different. Whereas the ASP Response.Write shortcut syntax was evaluated
                                          when the page was processed, the ASP.NET data binding syntax is evaluated only when the
 HTML Pattern Matching
                                          DataBind method is invoked.

ASP.NET Web Applications                  DataBind is a method of the Page and all server controls. When you call DataBind on a
 Application Overview                     parent control, it cascades to all of the children of the control. So, for example,
                                          DataList1.DataBind() invokes the DataBind method on each of the controls in the
 Using the Global.asax File
                                          DataList templates. Calling DataBind on the Page -- Page.DataBind() or simply
 Managing Application State               DataBind() -- causes all data binding expressions on the page to be evaluated. DataBind is
 HttpHandlers and Factories               commonly called from the Page_Load event, as shown in the following example.


Cache Services
                                                Protected Sub Page_Load(Src As Object, E As EventArgs)
 Caching Overview                                   DataBind()
 Page Output Caching                            End Sub
 Page Fragment Caching
 Page Data Caching                        VB


Configuration                             You can use a binding expression almost anywhere in the declarative section of an .aspx page,
                                          provided it evaluates to the expected data type at run time. The simple property, expression,
 Configuration Overview
                                          and method examples above display text to the user when evaluated. In these cases, the data
 Configuration File Format                binding expression must evaluate to a value of type String. In the collection example, the data
 Retrieving Configuration                 binding expression evaluates to a value of valid type for the DataSource property of ListBox.
                                          You might find it necessary to coerce the type of value in your binding expression to produce
                                          the desired result. For example, if count is an integer:
Deployment
 Deploying Applications                         Number of Records: <%# count.ToString() %>
 Using the Process Model
 Handling Errors
                                          Binding to Simple Properties

Security                                  The ASP.NET data binding syntax supports binding to public variables, properties of the Page,
 Security Overview                        and properties of other controls on the page.
 Authentication & Authorization



 http://samples.gotdotnet.com/quickstart/aspplus/doc/webdatabinding.aspx (1 of 4) [4/02/2002 8:50:39 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Windows-based Authentication             The following example illustrates binding to a public variable and simple property on the page.
                                          Note that these values are initialized before DataBind() is called.
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding                     VB DataBind1.aspx

 Localizing ASP.NET Applications
                                                 [Run Sample] | [View Source]
 Working with Resource Files

                                          The following example illustrates binding to a property of another control.
Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger
                                                  VB DataBind2.aspx

Performance                                      [Run Sample] | [View Source]
 Performance Overview
 Performance Tuning Tips
 Measuring Performance                    Binding to Collections and Lists

                                          List server controls like DataGrid, ListBox and HTMLSelect use a collection as a data source.
ASP to ASP.NET Migration
                                          The following examples illustrate binding to usual common language runtime collection types.
 Migration Overview                       These controls can bind only to collections that support the IEnumerable, ICollection, or
 Syntax and Semantics                     IListSource interface. Most commonly, you'll bind to ArrayList, Hashtable, DataView and
 Language Compatibility                   DataReader.
 COM Interoperability
 Transactions                             The following example illustrates binding to an ArrayList.


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com
                                                  VB DataBind3.aspx

 Get URL for this page
                                                 [Run Sample] | [View Source]


                                          The following example illustrates binding to a DataView. Note that the DataView class is
                                          defined in the System.Data namespace.




                                                  VB DataBind4.aspx

                                                 [Run Sample] | [View Source]


                                          The following example illustrates binding to a Hashtable.


 http://samples.gotdotnet.com/quickstart/aspplus/doc/webdatabinding.aspx (2 of 4) [4/02/2002 8:50:39 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                 VB DataBind5.aspx

                                                [Run Sample] | [View Source]


                                         Binding Expressions or Methods

                                         Often, you'll want to manipulate data before binding to your page or a control. The following
                                         example illustrates binding to an expression and the return value of a method.




                                                 VB DataBind6.aspx

                                                [Run Sample] | [View Source]


                                         DataBinder.Eval

                                         The ASP.NET framework supplies a static method that evaluates late-bound data binding
                                         expressions and optionally formats the result as a string. DataBinder.Eval is convenient in
                                         that it eliminates much of the explicit casting the developer must do to coerce values to the
                                         desired data type. It is particularly useful when data binding controls within a templated list,
                                         because often both the data row and the data field must be cast.


                                         Consider the following example, where an integer will be displayed as a currency string. With
                                         the standard ASP.NET data binding syntax, you must first cast the type of the data row in order
                                         to retrieve the data field, IntegerValue. Next, this is passed as an argument to the
                                         String.Format method.



                                               <%# String.Format("{0:c}", (Container.DataItem.("IntegerValue") %>


                                         VB


                                         This syntax can be complex and difficult to remember. In contrast, DataBinder.Eval is simply
                                         a method with three arguments: the naming container for the data item, the data field name,
                                         and a format string. In a templated list like DataList, DataGrid, or Repeater, the naming
                                         container is always Container.DataItem. Page is another naming container that can be
                                         used with DataBinder.Eval.



                                               <%# DataBinder.Eval(Container.DataItem, "IntegerValue", "{0:c}") %>


                                         VB


                                         The format string argument is optional. If it is omitted, DataBinder.Eval returns a value of
                                         type object, as shown in the following example.



                                               <%# CType(DataBinder.Eval(Container.DataItem, "BoolValue"), Boolean) %>


http://samples.gotdotnet.com/quickstart/aspplus/doc/webdatabinding.aspx (3 of 4) [4/02/2002 8:50:39 AM]
Microsoft ASP.NET QuickStarts Tutorial


                                         VB


                                         It is important to note that DataBinder.Eval can carry a noticeable performance penalty over
                                         the standard data binding syntax because it uses late-bound reflection. Use DataBinder.Eval
                                         judiciously, especially when string formatting is not required.




                                                 VB DataBind7.aspx

                                                [Run Sample] | [View Source]


                                         Section Summary

                                               1. The ASP.NET declarative data binding syntax uses the <%# %> notation.
                                               2. You can bind to data sources, properties of the page or another control, collections,
                                                  expressions, and results returned from method calls.
                                               3. List controls can bind to collections that support the ICollection, IEnumerable, or
                                                  IListSource interface, such as ArrayList, Hashtable, DataView, and DataReader.
                                               4. DataBinder.Eval is a static method for late binding. Its syntax can be simpler than
                                                  the standard data binding syntax, but performance is slower.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webdatabinding.aspx (4 of 4) [4/02/2002 8:50:39 AM]
Microsoft ASP.NET QuickStarts Tutorial

    Getting Started                          Server-Side Data Access
     Introduction
     What is ASP.NET?                                  Introduction to Server-Side Data
     Language Support                                  Connections, Commands, and DataSets
                                                       Accessing SQL-based Data
    ASP.NET Web Forms                                  Binding SQL Data to a DataGrid
     Introducing Web Forms                             Performing a Parameterized Select
     Working with Server Controls                      Inserting Data in a SQL Database
     Applying Styles to Controls                       Updating Data in a SQL Database
     Server Control Form Validation                    Deleting Data in a SQL Database
     Web Forms User Controls                           Sorting Data from a SQL Database
     Data Binding Server Controls                      Working with Master-Detail Relationships
     Server-Side Data Access                           Writing and Using Stored Procedures
     Data Access and Customization                     Accessing XML-based Data
     Working with Business Objects                     Section Summary
     Authoring Custom Controls
     Web Forms Controls Reference
     Web Forms Syntax Reference              Introduction to Server-Side Data

    ASP.NET Web Services                     Data access is the heart of any real-world application, and ASP.NET provides a rich set of controls that are well-integrated with the managed data access
     Introducing Web Services                APIs provided in the common language runtime. This section walks through several iterations of a sample that uses the ASP.NET DataGrid control to bind
                                             to the results of SQL queries and XML data files. This section assumes some familiarity with database fundamentals and the SQL query language.
     Writing a Simple Web Service
     Web Service Type Marshalling
                                             Server-side data access is unique in that Web pages are basically stateless, which presents some difficult challenges when trying to perform transactions
     Using Data in Web Services              such as inserting or updating records from a set of data retrieved from a database. As you'll see in this section, the DataGrid control can help manage
     Using Objects and Intrinsics            these challenges, allowing you to concentrate more on your application logic and less on the details of state management and event handling.
     The WebService Behavior
     HTML Pattern Matching
                                             Connections, Commands, and Datasets
    ASP.NET Web Applications
     Application Overview                    The common language runtime provides a complete set of managed data access APIs for data-intensive application development. These APIs help to
     Using the Global.asax File              abstract the data and present it in a consistent way regardless of its actual source (SQL Server, OLEDB, XML, and so on). There are essentially three
                                             objects you will work with most often: connections, commands, and datasets.
     Managing Application State
     HttpHandlers and Factories
                                                   q   A connection represents a physical connection to some data store, such as SQL Server or an XML file.
                                                   q   A command represents a directive to retrieve from (select) or manipulate (insert, update, delete) the data store.
    Cache Services                                 q   A dataset represents the actual data an application works with. Note that datasets are always disconnected from their source connection and data
                                                       model and can be modified independently. However, changes to a dataset can be easily reconciled with the originating data model.
     Caching Overview
     Page Output Caching
                                             For a more detailed walkthrough of the managed data access solution in the common language runtime, please read the ADO.NET Overview section of this
     Page Fragment Caching
                                             tutorial.
     Page Data Caching

http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (1 of 14) [4/02/2002 8:50:51 AM]
Microsoft ASP.NET QuickStarts Tutorial
                                             Accessing SQL-based Data
    Configuration
     Configuration Overview
                                             An application typically needs to perform one or more select, insert, update, or delete queries to a SQL database. The following table shows an example of
     Configuration File Format               each of these queries.
     Retrieving Configuration

                                              Query                               Example
    Deployment
                                              Simple Select                       SELECT * from Employees WHERE FirstName = 'Bradley';
     Deploying Applications
     Using the Process Model                  Join Select                         SELECT * from Employees E, Managers M WHERE E.FirstName =
                                                                                  M.FirstName;
     Handling Errors
                                              Insert                              INSERT into Employees VALUES ('123-45-
                                                                                  6789','Bradley','Millington','Program Manager');
    Security
     Security Overview                        Update                              UPDATE Employees SET Title = 'Development Lead' WHERE FirstName =
                                                                                  'Bradley';
     Authentication & Authorization
     Windows-based Authentication             Delete                              DELETE from Employees WHERE Productivity < 10;

     Forms-based Authentication
     Authorizing Users and Roles             To give your page access to the classes you will need to perform SQL data access, you must import the System.Data and System.Data.SqlClient
     User Account Impersonation              namespaces into your page.

     Security and WebServices
                                                  <%@ Import Namespace="System.Data" %>
                                                  <%@ Import Namespace="System.Data.SqlClient" %>
    Localization
     Internationalization Overview           To perform a select query to a SQL database, you create a SqlConnection to the database passing the connection string, and then construct a
     Setting Culture and Encoding            SqlDataAdapter object that contains your query statement. To populate a DataSet object with the results from the query, you call the command's Fill
     Localizing ASP.NET Applications         method.
     Working with Resource Files

                                                  Dim myConnection As New SqlConnection("server=(local)\NetSDK;database=pubs;Trusted_Connection=yes")
    Tracing                                       Dim myCommand As New SqlDataAdapter("select * from Authors", myConnection)
     Tracing Overview                             Dim ds As New DataSet()
     Trace Logging to Page Output                 myCommand.Fill(ds, "Authors")
     Application-level Trace Logging
                                             VB
    Debugging
     The SDK Debugger                        As mentioned earlier in this section, the benefit of using a dataset is that it gives you a disconnected view of the database. You can operate on a dataset in
                                             your application, and then reconcile your changes with the actual database later. For long-running applications this is often the best approach. For Web
                                             applications, you are usually performing short operations with each request (commonly to simply display the data). You often don't need to hold a DataSet
    Performance                              object over a series of several requests. For situations like these, you can use a SqlDataReader.
     Performance Overview
     Performance Tuning Tips                 A SqlDataReader provides a forward-only, read-only pointer over data retrieved from a SQL database. Because SqlDataReader uses a Tabular Data
     Measuring Performance                   Stream (TDS) to read data directly from a database connection, it performs more effectively than a DataSet if it can be used for your scenario.


                                             To use a SqlDataReader, you declare a SqlCommand instead of a SqlDataAdapter. The SqlCommand exposes an ExecuteReader method that
    ASP to ASP.NET Migration
http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (2 of 14) [4/02/2002 8:50:51 AM]
Microsoft ASP.NET QuickStarts Tutorial
     Migration Overview                      returns a SqlDataReader. Note also that you must explicitly open and close the SqlConnection when you use a SqlCommand. After a call to
                                             ExecuteReader, the SqlDataReader can be bound to an ASP.NET server control, as you'll see in the next section.
     Syntax and Semantics
     Language Compatibility
     COM Interoperability                         Dim myConnection As SqlConnection = New SqlConnection("server=(local)\NetSDK;database=pubs;Trusted_Connection=yes")
     Transactions                                 Dim myCommand As SqlCommand = New SqlCommand("select * from Authors", myConnection)

                                                  myConnection.Open()
    Sample Applications
     A Personalized Portal                        Dim dr As SqlDataReader = myCommand.ExecuteReader()
     An E-Commerce Storefront
                                                  ...
     A Class Browser Application
     IBuySpy.com                                  myConnection.Close()


     Get URL for this page                   VB


                                             When performing commands that do not require data to be returned, such as inserts, updates, and deletes, you also use a SqlCommand. The command
                                             is issued by calling an ExecuteNonQuery method, which returns the number of rows affected. Note that the connection must be explicitly opened when
                                             you use the SqlCommand; the SqlDataAdapter automatically handles opening the connection for you.



                                                  Dim myConnection As New SqlConnection("server=(local)\NetSDK;database=pubs;Trusted_Connection=yes")
                                                  Dim myCommand As New SqlCommand( _
                                                                     "UPDATE Authors SET phone='(800) 555-5555' WHERE au_id = '123-45-6789'", _
                                                                      myConnection)

                                                  myCommand.Connection.Open()
                                                  myCommand.ExecuteNonQuery()
                                                  myCommand.Connection.Close()


                                             VB


                                             Important: Always remember to close the connection to the data model before the page finishes executing. If you do not close the connection, you might
                                             inadvertently exhaust the connection limit while waiting for the page instances to be handled by garbage collection.

                                             Binding SQL Data to a DataGrid

                                             The following sample shows a simple select query bound to a DataGrid control. The DataGrid renders a table containing the SQL data.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (3 of 14) [4/02/2002 8:50:51 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                      VB DataGrid1.aspx

                                                      [Run Sample] | [View Source]


                                               Like the DropDownList shown in the Data Binding section, the DataGrid control supports a DataSource property that takes an IEnumerable or
                                               ICollection, as well as a DataSet. You can use a DataSet by assigning the DefaultView property of a table contained in the DataSet to the name of
                                               the table you wish to use within the DataSet. The DefaultView property represents the current state of a table within a DataSet, including any changes
                                               which have been made by application code (row deletions or value changes, for example). After setting the DataSource property, you call DataBind()
                                               to populate the control.



                                                    MyDataGrid.DataSource=ds.Tables("Authors").DefaultView
                                                    MyDataGrid.DataBind()


                                               VB


                                               An alternative syntax is to specify both a DataSource and a DataMember. In this case, ASP.NET automatically gets the DefaultView for you.



                                                    MyDataGrid.DataSource=ds
                                                    MyDataGrid.DataMember="Authors"
                                                    MyDataGrid.DataBind()


                                               VB


                                               You can also bind directly to a SqlDataReader. In this case you are only displaying data, so the forward-only nature of the SqlDataReader is perfectly
                                               suited to this scenario, and you benefit from the performance boost that SqlDataReader provides.




                                                      VB DataGrid1.1.aspx

                                                      [Run Sample] | [View Source]


                                              Note: For the remainder of this section, only the DataSet model of data access is shown; however, any of these samples could be re-written to take
http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (4 of 14) [4/02/2002 8:50:51 AM]
Microsoft ASP.NET QuickStarts Tutorial
                                             advantage of SQLDataReader as well.

                                             Performing a Parameterized Select

                                             You can also perform a parameterized select using the SqlDataAdapter object. The following sample shows how you can modify the data selected using
                                             the value posted from a select HtmlControl.




                                                     VB DataGrid2.aspx

                                                    [Run Sample] | [View Source]


                                             The SqlDataAdapter maintains a Parameters collection that can be used to replace variable identifiers (denoted by an "@" in front of the name) with
                                             values. You add a new SqlParameter to this collection that specifies the name, type, and size of the parameter, and then set its Value property to the
                                             value of the select.



                                                  myCommand.SelectCommand.Parameters.Add(New SqlParameter("@State", SqlDbType.NVarChar, 2))
                                                  myCommand.SelectCommand.Parameters("@State").Value = MySelect.Value


                                             VB


                                             Important: Note that the DataGrid's EnableViewState property has been set to false. If the data will be populated in each request, there is no benefit
                                             to having the DataGrid store state information to be sent through a round trip with form posts. Because the DataGrid stores all of its data when
                                             maintaining state, it is important to turn it off when appropriate to improve the performance of your pages.


                                             DataGrid2.aspx statically populates the values of the select box, but this will not work well if those values ever change in the database. Because the select
                                             HtmlControl also supports an IEnumerable DataSource property, you can use a select query to dynamically populate the select box instead, which
                                             guarantees that the database and user interface are always in sync. The following sample demonstrates this process.




                                                     VB DataGrid3.aspx

                                                    [Run Sample] | [View Source]

http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (5 of 14) [4/02/2002 8:50:51 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                           Inserting Data in a SQL Database

                                           To insert a row into the database, you can add a simple input form to the page, and execute an insert command in the form submit event handler. Just as
                                           in the previous two samples, you use the command object's Parameters collection to populate the command's values. Note that you also check to make
                                           sure the required values are not null before attempting to insert into the database. This prevents an accidental violation of the database's field constraints.
                                           You also execute the insert command inside of a try/catch block, just in case the primary key for inserted row already exists.




                                                   VB DataGrid4.aspx

                                                  [Run Sample] | [View Source]


                                           Instead of explicitly checking the input values, you could have just as easily used the validator controls provided with ASP.NET. The following sample shows
                                           how to do that. Note that using the RegEx Validator provides the additional benefit of checking the format for the author ID, zip code, and phone number
                                           fields.




                                                   VB DataGrid5.aspx

                                                  [Run Sample] | [View Source]


                                           Updating Data in a SQL Database

                                           Updating a database can often be tricky in Web applications. The DataGrid control provides some built-in support for this scenario that makes updates
                                           easier. To allow rows to be edited, the DataGrid supports an integer EditItemIndex property, which indicates which row of the grid should be editable.
                                           When this property is set, the DataGrid renders the row at that index as text input boxes instead of simple labels. A value of -1 (the default) indicates that
                                           no rows are editable. The page can enclose the DataGrid in a server-side form and get access to the edited data through the DataGrid's object model.


                                           To figure out which row should be editable, you need a way to accept some input from the user about which row they would like to edit. The DataGrid
                                           can contain an EditCommandColumn that renders links for firing three special events: EditCommand, UpdateCommand, and CancelCommand. The
                                           EditCommandColumn is declaratively added to the DataGrid's Columns collection, as shown in the following example.


                                                    <ASP:DataGrid id="MyDataGrid" runat="server"
                                                      ...
http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (6 of 14) [4/02/2002 8:50:51 AM]
Microsoft ASP.NET QuickStarts Tutorial
                                                      OnEditCommand="MyDataGrid_Edit"
                                                      OnCancelCommand="MyDataGrid_Cancel"
                                                      OnUpdateCommand="MyDataGrid_Update"
                                                      DataKeyField="au_id"
                                                  >

                                                      <Columns>
                                                        <asp:EditCommandColumn EditText="Edit" CancelText="Cancel" UpdateText="Update" />
                                                      </Columns>

                                                  </ASP:DataGrid>


                                             On the DataGrid tag itself, you wire event handlers to each of the commands fired from the EditCommandColumn. The
                                             DataGridCommandEventArgs argument of these handlers gives you direct access to the index selected by the client, which you use to set the
                                             DataGrid's EditItemIndex. Note that you need to re-bind the DataGrid for the change to take effect, as shown in the following example.



                                                  Public Sub MyDataGrid_Edit(sender As Object, E As DataGridCommandEventArgs)
                                                      MyDataGrid.EditItemIndex = E.Item.ItemIndex
                                                      BindGrid()
                                                  End Sub


                                             VB


                                             When a row of the DataGrid is being edited, the EditCommandColumn renders the Update and Cancel links. If the client selects Cancel, you simply
                                             set the EditItemIndex back to -1. If the client selects Update, however, you need to execute your update command to the database. Performing an
                                             update query requires that you know the primary key in the database for the row you wish to update. To support this, the DataGrid exposes a
                                             DataKeyField property that you can set to the field name for the primary key. In the event handler wired to the UpdateCommand, you can retrieve the
                                             key name from the DataGrid's DataKeys collection. You index into this collection using the ItemIndex of the event, as shown in the following example.



                                                  myCommand.Parameters("@Id").Value = MyDataGrid.DataKeys(CType(E.Item.ItemIndex, Integer))


                                             VB


                                             At the end of the Update event handler, you set the EditItemIndex back to -1. The following sample demonstrates this code in action.




                                                      VB DataGrid6.aspx

                                                      [Run Sample] | [View Source]


http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (7 of 14) [4/02/2002 8:50:51 AM]
Microsoft ASP.NET QuickStarts Tutorial
                                             One problem with the preceding example is that the primary key field (au_id) also renders as a text input box when a row is editable. You don't want the
                                             client to change this value, because you need it to determine which row to update in the database. Fortunately, you can disable this column from rendering
                                             as a text box by specifying exactly what each column looks like for the editable row. You do this by defining each row in the DataGrid's Columns
                                             collection, using the BoundColumn control to assign data fields with each column. Using this technique gives you complete control over the order of the
                                             columns, as well as their ReadOnly properties. For the au_id column you set the ReadOnly property to true. When a row is in edit mode, this column will
                                             continue to render as a Label. The following sample demonstrates this technique.




                                                    VB DataGrid7.aspx

                                                    [Run Sample] | [View Source]


                                             BoundColumn controls aren't the only controls you can set in the DataGrid's Columns collection. You can also specify a TemplateColumn, which gives
                                             you complete control over the contents of the column. The template is just arbitrary content; you can render anything you like, including server controls,
                                             inside the DataGrid's columns. The following sample demonstrates using the TemplateColumn control to render the "State" column as a drop-down list
                                             and the "Contract" column as a check box HtmlControl. The ASP.NET data binding syntax is used to output the data field value within the template. Note
                                             that there is a bit of tricky logic to make the drop-down list and check box reflect the state of the data inside the row.




                                                    VB DataGrid8.aspx

                                                    [Run Sample] | [View Source]


                                             Just as you can place a drop-down list or check box HtmlControl in a TemplateColumn, you can also place other controls there. The following sample
                                             adds Validator controls to the columns to check the client input before attempting to perform the update.




                                                    VB DataGrid9.aspx

                                                    [Run Sample] | [View Source]
http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (8 of 14) [4/02/2002 8:50:51 AM]
Microsoft ASP.NET QuickStarts Tutorial


                                             Deleting Data in a SQL Database

                                             Deleting from a database is very similar to an update or insert command, but you still need a way to determine the particular row of the grid to delete.
                                             Another control that can be added to the DataGrid's Columns collection is the ButtonColumn control, which simply renders a button control.
                                             ButtonColumn supports a CommandName property that can be set to Delete. On the DataGrid, you wire an event handler to the DeleteCommand,
                                             where you perform the delete operation. Again, you use the DataKeys collection to determine the row selected by the client. The following sample
                                             demonstrates this process.




                                                    VB DataGrid10.aspx

                                                    [Run Sample] | [View Source]


                                             Sorting Data from a SQL Database

                                             A common requirement for any grid is the ability to sort the data it contains. While the DataGrid control doesn't explicitly sort its data for you, it does
                                             provide a way to call an event handler when the user clicks a column header, which you can use to sort the data. When the DataGrid's AllowSorting
                                             property is set to true, it renders hyperlinks for the column headers that fire a Sort command back to the grid. You set the OnSortCommand property of
                                             the DataGrid to the handler you want to call when the user clicks a column link. The name of the column is passed as a SortExpression property on the
                                             DataGridSortCommandEventArgs argument, which you can use to set the Sort property of the DataView bound to the grid. The following example
                                             demonstrates this process.



                                                  <script>
                                                      Protected Sub MyDataGrid_Sort(Src As Object, E As DataGridSortCommandEventArgs)
                                                           ...
                                                           DataView Source = ds.Tables("Authors").DefaultView
                                                           Source.Sort = E.SortExpression
                                                           MyDataGrid.DataBind()
                                                      End Sub
                                                  </script>

                                                  <form runat="server">
                                                      <ASP:DataGrid id="MyDataGrid" OnSortCommand="MyDataGrid_Sort" AllowSorting="true" runat="server" />
                                                  </form>


                                             VB


                                             The following sample shows this code in action.


http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (9 of 14) [4/02/2002 8:50:51 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                     VB DataGrid11.aspx

                                                    [Run Sample] | [View Source]


                                             When using BoundColumn controls, you can explicitly set the SortExpression property for each column, as demonstrated in the following sample.




                                                     VB DataGrid12.aspx

                                                    [Run Sample] | [View Source]


                                             Working with Master-Detail Relationships

                                             Often your data model will contain relationships that cannot be represented using just a single grid. A very common Web-based interface is one in which a
                                             row of data can be selected that navigates the client to a "details" page, which displays detailed information about the selected row. To accomplish this
                                             using the DataGrid, you can add a HyperLinkColumn to the Columns collection, which specifies the details page to which the client will navigate when
                                             the link is clicked. You use the format string syntax to substitute a field value in this link, which is passed as a querystring argument. The following example
                                             demonstrates this process.


                                                        <ASP:DataGrid id="MyDataGrid" runat="server">

                                                           <Columns>
                                                               <asp:HyperLinkColumn
                                                                  DataNavigateUrlField="au_id"
                                                                  DataNavigateUrlFormatString="datagrid13_details.aspx?id={0}"
                                                                  Text="Get Details"
                                                               />
                                                           </Columns>

                                                        </ASP:DataGrid>


                                             On the details page, you retrieve the querystring argument and perform a join select to obtain details from the database. The following sample
                                             demonstrates this scenario.



http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (10 of 14) [4/02/2002 8:50:51 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                    VB DataGrid13.aspx

                                                    [Run Sample] | [View Source]


                                             Writing and Using Stored Procedures

                                             In general, performing ad hoc queries comes at the expense of performance. Using stored procedures can reduce the cost of performing heavy database
                                             operations in an application. A stored procedure is easy to create, and can even be done using a SQL statement. The following code example creates a
                                             stored procedure that simply returns a table.


                                                  CREATE Procedure GetAuthors AS
                                                      SELECT * FROM Authors
                                                      return
                                                  GO


                                             You can create stored procedures that accept parameters as well. For example:


                                                  CREATE Procedure LoadPersonalizationSettings (@UserId varchar(50)) AS
                                                      SELECT * FROM Personalization WHERE UserID=@UserId
                                                      return
                                                  GO


                                             Using a stored procedure from an ASP.NET page is just an extension of what you've learned so far about the SqlCommand object. The CommandText is
                                             just the name of the stored procedure instead of the ad hoc query text. You indicate to the SqlCommand that the CommandText is a stored procedure
                                             by setting the CommandType property.



                                                  myCommand.SelectCommand.CommandType = CommandType.StoredProcedure


                                             VB


                                             The following sample demonstrates a call to a stored procedure to fill the DataSet.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (11 of 14) [4/02/2002 8:50:51 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                    VB DataGrid14.aspx

                                                    [Run Sample] | [View Source]


                                             Parameters to stored procedures are passed just as they are for ad hoc queries, as shown in the following samples.




                                                    VB DataGrid15.aspx

                                                    [Run Sample] | [View Source]




                                                    VB DataGrid16.aspx

                                                    [Run Sample] | [View Source]


                                             Accessing XML-based Data

                                             At the beginning of this section it was mentioned that the DataSet was designed to abstract data in a way that is independent of the actual data source.
                                             You can see this by changing the focus of your samples from SQL to XML. The DataSet supports a ReadXml method that takes a FileStream object as
                                             its parameter. The file you read in this case must contain both a schema and the data you wish to read. The DataSet expects data to be in the form, as
                                             shown in the following example.


                                                  <DocumentElement>
                                                      <TableName>
                                                          <ColumnName1>column value</ColumnName1>
                                                          <ColumnName2>column value</ColumnName2>
                                                          <ColumnName3>column value</ColumnName3>
http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (12 of 14) [4/02/2002 8:50:51 AM]
Microsoft ASP.NET QuickStarts Tutorial
                                                          <ColumnName4>column           value</ColumnName4>
                                                      </TableName>
                                                      <TableName>
                                                          <ColumnName1>column           value</ColumnName1>
                                                          <ColumnName2>column           value</ColumnName2>
                                                          <ColumnName3>column           value</ColumnName3>
                                                          <ColumnName4>column           value</ColumnName4>
                                                      </TableName>
                                                  </DocumentElement>


                                             Each TableName section corresponds to a single row in the table. The following sample shows reading schema and data from an XML file using the
                                             ReadXml method of the DataSet. Note that after the data is read into the DataSet it is indistinguishable from SQL data -- the DataGrid binds to it just
                                             the same, as shown in the following sample.




                                                    VB DataGrid17.aspx

                                                    [Run Sample] | [View Source]


                                             You can also read the data and schema separately, using the ReadXmlData and ReadXmlSchema methods of the DataSet, as shown in the following
                                             sample.




                                                    VB DataGrid18.aspx

                                                    [Run Sample] | [View Source]


                                             Just as the DataSet supports reader methods for XML data, it also supports writing the data. The following sample implements a tool for selecting data
                                             from SQL and writing the result as XML data or schema text.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (13 of 14) [4/02/2002 8:50:51 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                    VB XMLGen.aspx

                                                   [Run Sample] | [View Source]


                                             Section Summary

                                                  1. The common language runtime's managed data access APIs abstract data and present it in a consistent way regardless of its actual source (SQL
                                                     Server, OLEDB, XML, and so on).
                                                  2. To give your page access to the classes you will need to perform SQL data access, you must import the System.Data and
                                                     System.Data.SqlClient namespaces into your page.
                                                  3. Populating a dataset from a SQL query involves creating a SqlConnection, associating a SqlDataAdapter object with the connection that
                                                     contains your query statement, and filling the dataset from the command.
                                                  4. The DataGrid control supports a DataSource property that takes an IEnumerable (or ICollection) type. You can set this to the result of a
                                                     SQL query by assigning the DataSet's DefaultView property, which is of type DataView.
                                                  5. The SqlDataAdapter maintains a Parameters collection that can be used to replace variable identifiers (denoted by an "@" in front of the name)
                                                     with values.
                                                  6. When performing commands that do not require data to be returned, such as inserts, updates, and deletes, you use a SqlCommand instead of
                                                     the SqlDataAdapter. The command is issued by calling an ExecuteNonQuery method, which returns the number of rows affected.
                                                  7. The SqlConnection must be explicitly opened when you use the SqlCommand (the SqlDataAdapter automatically handles opening the
                                                     connection for you). Always remember to close the SqlConnection to the data model before the page finishes executing. If you do not close the
                                                     connection, you migh inadvertantly exhaust the connection limit while waiting for the page instances to be released to garbage collection.
                                                  8. To allow rows to be edited, the DataGrid supports an integer EditItemIndex property, which indicates which row of the grid should be editable.
                                                     When this property is set, the DataGrid renders the row at that index as text input boxes instead of simple labels.
                                                  9. The DataGrid exposes a DataKeyField property that you can set to the field name for the primary key. In the event handler wired to the
                                                     UpdateCommand, you can retrieve the key name from the DataGrid's DataKeys collection.
                                                 10. Using BoundColumn controls in the DataGrid gives you complete control over the order of the columns, as well as their ReadOnly properties.
                                                 11. Using TemplateColumn controls in the DataGrid gives you complete control over the contents of the column.
                                                 12. The ButtonColumn control can be used to simply render a button control in each row for that column, which can be associated with an event.
                                                 13. A HyperLinkColumn can be added to the DataGrid's Columns collection, which supports navigating to another page when the link is clicked.
                                                 14. When the DataGrid's AllowSorting property is set to true, it renders hyperlinks for the column headers that fire a Sort command back to the
                                                     grid. You set the OnSortCommand property of the DataGrid to the handler you want to call when the user clicks a column link.
                                                 15. The DataSet supports ReadXml, ReadXmlData, and ReadXmlSchema methods that take a FileStream as a parameter, which can be used
                                                     to populate a DataSet from an XML file.
                                                 16. Using stored procedures can reduce the cost of performing heavy database operations in an application.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx (14 of 14) [4/02/2002 8:50:51 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                    Data Access and Customization
 Introduction
 What is ASP.NET?                          Introduction to Templated Controls
 Language Support                          Handling Postbacks from a Template
                                           Using Select and Edit Templates
ASP.NET Web Forms                          Finding a Control Inside a Template
 Introducing Web Forms                     Section Summary
 Working with Server Controls
 Applying Styles to Controls
 Server Control Form Validation    Introduction to Templated Controls
 Web Forms User Controls
 Data Binding Server Controls      While the DataGrid server control demonstrated in the previous section is suitable for many Web application scenarios where a
 Server-Side Data Access           grid-like representation of data is appropriate, many times the presentation of data needs to be much richer. ASP.NET offers two
                                   controls, DataList and Repeater, that give you greater flexibility over the rendering of list-like data. These controls are template-
 Data Access and Customization     based, and so have no default rendering of their own. The way data is rendered is completely determined by the your
 Working with Business Objects     implementation of the control's templates, which describe how to present data items.
 Authoring Custom Controls
 Web Forms Controls Reference      Like the DataGrid control, DataList and Repeater support a DataSource property, which can be set to any ICollection,
 Web Forms Syntax Reference        IEnumerable, or IListSource type. The data in this DataSource is bound to the control using its DataBind method. Once the
                                   data is bound, the format of each data item is described by a template.

ASP.NET Web Services               The ItemTemplate property controls the rendering of each item in the DataSource collection. Inside an ItemTemplate, you
 Introducing Web Services          can define any arbitrary presentation code (HTML or otherwise). Using the ASP.NET data binding syntax, you can insert values
 Writing a Simple Web Service      from the data bound to the DataList or Repeater control, as shown in the following example.
 Web Service Type Marshalling
 Using Data in Web Services               <ASP:Repeater id="MyRepeater" runat="server">

 Using Objects and Intrinsics                 <ItemTemplate>
 The WebService Behavior                          Hello <%# DataBinder.Eval(Container.DataItem, "name") %> !
                                              </ItemTemplate>
 HTML Pattern Matching
                                          </ASP:Repeater>
ASP.NET Web Applications
 Application Overview              The Container represents the first control in the immediate hierarchy that supports the System.Web.UI.INamingContainer
                                   marker interface. In this case, the Container resolves to an object of type System.Web.UI.WebControls.RepeaterItem,
 Using the Global.asax File
                                   which has a DataItem property. As the Repeater iterates over the DataSource collection, the DataItem contains the current
 Managing Application State        item in this collection. For example, if the data source is set to an ArrayList of Employee objects, the DataItem is of type
 HttpHandlers and Factories        Employees. When bound to a DataView, the DataItem is of type DataRowView.


                                   The following example demonstrates a Repeater control bound to a DataView (returned from a SQL query). HeaderTemplate
Cache Services                     and FooterTemplate have also been defined and render at the beginning and end of the list, respectively.
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
                                           VB DataList1.aspx
 Configuration File Format
 Retrieving Configuration                  [Run Sample] | [View Source]

Deployment                         The Repeater control just iterates over the bound data, rendering the ItemTemplate once for each item in the DataSource
 Deploying Applications            collection. It does not render anything besides the elements contained in its templates. While the Repeater is a general purpose
 Using the Process Model           iterator, the DataList provides some additional features for controlling the layout of the list. Unlike the Repeater, DataList
 Handling Errors                   renders additonal elements, like table rows and cells and spans containing style attributes, outside of the template definition to
                                   enable this richer formatting. For example, DataList supports RepeatColumns and RepeatDirection properties that specify
                                   whether data should be rendered in multiple columns, and in which direction (vertical or horizontal) the data items should be
Security                           rendered. DataList also supports style attributes, as shown in the following example.
 Security Overview
 Authentication & Authorization           <ASP:DataList runat="server" DataSource="<%#MyData%>"
                                              RepeatColumns="2"
 Windows-based Authentication                 RepeatDirection="Horizontal"
 Forms-based Authentication                   ItemStyle-Font-Size="10pt"
 Authorizing Users and Roles                  ItemStyle-Font-Name="Verdana"
                                          >
 User Account Impersonation                   ...
 Security and WebServices                 </ASP:DataList>


Localization                       Note: The remainder of this section concentrates on the many features of the DataList control. For more information about the
                                   Repeater control, refer to the Repeater topic in the Web Forms Controls Reference section of this tutorial.
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications   The following sample demonstrates the use of the DataList control. Note that the look of the data items has been changed from
                                   the previous example, simply by changing the contents of the control's ItemTemplate property. The RepeatDirection and
 Working with Resource Files       RepeatColumns properties determine how the ItemTemplates are laid out.


Tracing

 http://samples.gotdotnet.com/quickstart/aspplus/doc/webdatalist.aspx (1 of 4) [4/02/2002 8:50:55 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger                          VB Datalist2.aspx

                                           [Run Sample] | [View Source]
Performance
 Performance Overview
 Performance Tuning Tips           The following example further demonstrates the infinite flexibility of templates by changing the ItemTemplate yet again. This
                                   time, one of the DataItem values has been substituted for the "src" attribute of an <img> tag. The format String parameter of
 Measuring Performance
                                   DataBinder.Eval has also been used to substitute a DataItem value in the query string for a URL.

ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions
                                           VB Datalist3.aspx

Sample Applications                        [Run Sample] | [View Source]
 A Personalized Portal
 An E-Commerce Storefront
                                   Handling Postbacks from a Template
 A Class Browser Application
 IBuySpy.com
                                   As in the DataGrid, you can fire a command from inside a DataList template that is passed to an event handler wired to the
                                   DataList itself. For example, a LinkButton inside the ItemTemplate might fire a Select command. By setting the
Get URL for this page              OnSelectedIndexChanged property of the DataList, you can call an event handler in response to this command. The
                                   following example demonstrates this process.


                                          <ASP:DataList id="MyDataList" OnSelectedIndexChanged="MyDataList_Select" runat="server">

                                              <ItemTemplate>

                                                  <asp:linkbutton CommandName="Select" runat="server">
                                                      <%# DataBinder.Eval(Container.DataItem, "title") %>
                                                  </asp:linkbutton>

                                              </ItemTemplate>

                                          </ASP:DataList>


                                   The following sample demonstrates this code in action. In the MyDataList_Select event handler, you populate several other
                                   server controls with the details about the particular selected item.




                                           VB Datalist4.aspx

                                           [Run Sample] | [View Source]


                                   Note that while the DataList recognizes a few special commands such as Select and Edit/Update/Cancel, the command
                                   string fired inside a template can be any arbitrary string. For all commands, the DataList's OnItemCommand is fired. You can
                                   wire this event to a handler as in the previous example; the following example shows how to do this.



                                          <script runat="server">

                                              Protected Sub MyDataList_ItemCommand(Sender As Object, E As DataListCommandEventArgs)
                                                  Dim Command As String = E.CommandName

                                                  Select Case Command
                                                      Case "Discuss"
                                                          ShowDiscussions(E.Item.DataItem)
                                                      Case "Ratings"
                                                          ShowRatings(E.Item.DataItem)
                                                  End Select
                                              End Sub

                                          </script>

                                          <ASP:DataList id="MyDataList" OnItemCommand="MyDataList_ItemCommand" runat="server">

                                              <ItemTemplate>



 http://samples.gotdotnet.com/quickstart/aspplus/doc/webdatalist.aspx (2 of 4) [4/02/2002 8:50:55 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                                  <asp:linkbutton CommandName="Ratings" runat="server">
                                                      View Ratings
                                                  </asp:linkbutton>
                                                  |
                                                  <asp:linkbutton CommandName="Discuss" runat="server">
                                                      View Discussions
                                                  </asp:linkbutton>

                                             </ItemTemplate>

                                         </ASP:DataList>


                                  VB


                                  Note that because more than one command can fire this event handler, you must employ a switch statement to determine the
                                  particular command that was fired. The following sample demonstrates this code in action.




                                          VB Datalist5.aspx

                                          [Run Sample] | [View Source]


                                  Using Select and Edit Templates

                                  In addition to handling the Select command using a page-level event handler, the DataList can respond to this event internally.
                                  If a SelectedItemTemplate is defined for the DataList, the DataList renders this template for the item that fired the Select
                                  command. The following example uses the SelectedItemTemplate to make the title of the selected book bold.




                                          VB Datalist6.aspx

                                          [Run Sample] | [View Source]


                                  DataList also supports an EditItemTemplate for rendering an item whose index is equal to the DataList's EditItemIndex
                                  property. For details about how editing and updating works, refer to the Updating Data topic of the Data Access section of this
                                  tutorial.




                                          VB Datalist7.aspx

                                          [Run Sample] | [View Source]


                                  Finding a Control Inside a Template

                                  Sometimes it is necessary to locate a control contained inside a template. If a control is given an ID in a template, that control
                                  can be retrieved from its container (the first control in the parent hierarchy that supports INamingContainer). In this case, the
                                  container is the DataListItem control. Note that even though there are several controls with the same ID (by virtue of the
                                  DataList's repetition), each is contained logically in the namespace of the DataListItem container control.


                                  You can go through the DataList's Items collection to retrieve the DataListItem for a given index, and then call the
                                  DataListItem's FindControl method (inherited from the base Control class) to retrieve a control with a particular ID.



                                         <script runat="server">

                                             Public Sub Page_Load(sender As Object, E As EventArgs))
                                                 ' set datasource and call databind here

                                                  For I=0 To MyDataList.Items.Count-1
                                                     Dim IsChecked As String = MyDataList.Items(i).FindControl("Save").Checked.ToString()
                                                     If IsChecked = "True" Then
                                                       ...


http://samples.gotdotnet.com/quickstart/aspplus/doc/webdatalist.aspx (3 of 4) [4/02/2002 8:50:55 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                                     End If
                                                 Next
                                             End Sub
                                         </script>

                                         <ASP:DataList id="MyDataList" runat="server">

                                              <ItemTemplate>
                                                   <asp:CheckBox id="Save" runat="server"/> <b>Save to Favorites</b>
                                              </ItemTemplate>

                                         </ASP:DataList>


                                  VB


                                  The following sample demonstrates this code in action.




                                           VB Datalist8.aspx

                                          [Run Sample] | [View Source]


                                  Section Summary

                                         1. The DataList and Repeater controls provide developers fine-tuned control over the rendering of data-bound lists.
                                         2. Rendering of bound data is controlled using a template, such as the HeaderTemplate, FooterTemplate, or
                                            ItemTemplate.
                                         3. The Repeater control is a general-purpose iterator, and does not insert anything in its rendering that is not contained in
                                            a template.
                                         4. The DataList control offers more control over the layout and style of items, and outputs its own rendering code for
                                            formatting.
                                         5. The DataList supports the Select, Edit/Update/Cancel, and Item Command events, which can be handled at the
                                            page level by wiring event handlers to the DataList's Command events.
                                         6. DataList supports a SelectedItemTemplate and EditItemTemplate for control over the rendering of a selected or
                                            editable item.
                                         7. Controls can be programmatically retrieved from a template using the Control.FindControl method. This should be
                                            called on a DataListItem retrieved from the DataList's Items collection.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webdatalist.aspx (4 of 4) [4/02/2002 8:50:55 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                       Working With Business Objects
 Introduction
 What is ASP.NET?                             The Application /Bin Directory
 Language Support                             Importing Business Objects
                                              A Simple Two-Tier Web Forms Page
ASP.NET Web Forms                             A Simple Three-Tier Web Forms Page
 Introducing Web Forms                        Section Summary
 Working with Server Controls
 Applying Styles to Controls
 Server Control Form Validation       Encapsulating logic in business components is an essential part of any real-world application, Web-based or
 Web Forms User Controls              otherwise. In ASP.NET, business objects are the building blocks for multi-tiered Web applications, such as those with
                                      a layer for data access or common application rules. This section demonstrates how to write some simple
 Data Binding Server Controls         components and include them in your application's Web Forms pages.
 Server-Side Data Access
 Data Access and Customization        The Application /Bin Directory
 Working with Business Objects
 Authoring Custom Controls            A problem with using the COM model for Web application components is that those components must be registered
 Web Forms Controls Reference         (typically using the regsvr32 tool) before they can be used from a traditional ASP application. Remote administration
 Web Forms Syntax Reference           of these types of applications is often not possible, because the registration tool must be run locally on the server. To
                                      make matters more difficult, these components remain locked on disk once they are loaded by an application, and the
                                      entire Web server must be stopped before these components can be replaced or removed.
ASP.NET Web Services
 Introducing Web Services             ASP.NET attempts to solve these problems by allowing components to be placed in a well-known directory, to be
 Writing a Simple Web Service         automatically found at run time. This well-known directory is always named /bin, and is located immediately under
                                      the root directory for the application (a virtual directory defined by Internet Information Services (IIS)). The benefit is
 Web Service Type Marshalling
                                      that no registration is required to make components available to the ASP.NET application -- components can be
 Using Data in Web Services           deployed by simply copying to the /bin directory or performing an FTP file transfer.
 Using Objects and Intrinsics
 The WebService Behavior              In addition to providing a zero-registration way to deploy compiled components, ASP.NET does not require these
 HTML Pattern Matching                components to remain locked on disk at run time. Behind the scenes, ASP.NET duplicates the assemblies found in
                                      /bin and loads these "shadow" copies instead. The original components can be replaced even while the Web server is
                                      still running, and changes to the /bin directory are automatically picked up by the runtime. When a change is
ASP.NET Web Applications              detected, ASP.NET allows currently executing requests to complete, and directs all new incoming requests to the
                                      application that uses the new component or components.
 Application Overview
 Using the Global.asax File           Importing Business Objects
 Managing Application State
 HttpHandlers and Factories           At its most basic level, a business component is just a class for which you can create an instance from a Web Forms
                                      page that imports it. The following example defines a simple HelloWorld class. The class has one public constructor
                                      (which is executed when an instance of the class is first created), a single String property called FirstName, and a
Cache Services                        SayHello method that prints a greeting using the value of the FirstName property.
 Caching Overview
 Page Output Caching
 Page Fragment Caching                     Imports System
                                           Imports System.Text
 Page Data Caching
                                           Namespace HelloWorld
                                             Public Class HelloObj
Configuration                                  Private _name As String
 Configuration Overview
                                                 Public Sub New
 Configuration File Format
                                                   MyBase.New()
 Retrieving Configuration                          _name = Nothing
                                                 End Sub

Deployment                                       Public Property FirstName As String
 Deploying Applications                            Get
 Using the Process Model                             Return(_name)
                                                   End get
 Handling Errors                                   Set
                                                     _name = value
                                                    End Set
Security                                         End Property
 Security Overview
 Authentication & Authorization                Public Function SayHello() As String
                                                 Dim sb As New StringBuilder("Hello ")
 Windows-based Authentication                    If (_name <> Nothing) Then
 Forms-based Authentication                         sb.Append(_name)
 Authorizing Users and Roles                     Else
                                                    sb.Append("World")
 User Account Impersonation                      End If
 Security and WebServices                        sb.Append("!")
                                                 Return(sb.ToString())
                                               End Function
Localization                                 End Class
 Internationalization Overview             End Namespace



 http://samples.gotdotnet.com/quickstart/aspplus/doc/businessobjs.aspx (1 of 3) [4/02/2002 8:50:58 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Setting Culture and Encoding
                                      VB
 Localizing ASP.NET Applications
 Working with Resource Files          To compile this class, the C# compiler (Csc.exe) is run from the command line. The /t option tells the compiler to
                                      build a library (DLL), and the /out option tells the compiler where to place the resulting assembly. In this case, the
                                      /bin directory for the application is directly under the "aspplus" vroot of this tutorial, and it is assumed this command
Tracing                               is being run from the sample directory, that is, ...\QuickStart\AspPlus\Samples\WebForms\Busobjs.
 Tracing Overview
 Trace Logging to Page Output
                                           csc /t:library /out:..\..\..\..\bin\HelloObj.dll HelloObj.cs
 Application-level Trace Logging

                                      For Visual Basic, the equivalent compilation command is:
Debugging
 The SDK Debugger                          vbc /t:library /out:..\..\..\..\bin\HelloObjVB.dll HelloObj.vb


Performance                           For JScript, the equivalent compilation command is:
 Performance Overview
 Performance Tuning Tips                   jsc /out:..\..\..\..\bin\HelloObjJS.dll HelloObj.js
 Measuring Performance
                                      The component is now available to any Web Forms page in the application that needs to use it. The following
                                      HelloObj.aspx example illustrates this functionality.
ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions

                                              VB HelloObj.aspx
Sample Applications
 A Personalized Portal
                                             [Run Sample] | [View Source]
 An E-Commerce Storefront
 A Class Browser Application
                                      Note the Import directive at the top of the page that specifies the namespace to include. Once the namespace is
 IBuySpy.com
                                      included using this directive, the class can be used from within the Web Forms page. Because the assembly is pre-
                                      loaded by the ASP.NET runtime, only a simple namespace import is required to make the component available. The
Get URL for this page                 following code example the Import directive.


                                           <%@ Import Namespace="HelloWorld" %>


                                      By default, ASP.NET loads all assemblies from the /bin directory when the application is started. The assemblies to
                                      load are specifed through the configuration system. For details, see the Configuration Overview section. Additional
                                      assemblies can be imported into an application using configuration as well. For example:


                                           <configuration>
                                               <compilation>
                                                   <assemblies>
                                                       <!--The following assemblies are loaded explicitly from the global cache-->
                                                       <add assembly="System.Data"/>
                                                       <add assembly="System.Web.Services"/>
                                                       <add assembly="System.Drawing"/>
                                                       <!--This tells ASP.NET to load all assemblies from /bin-->
                                                       <add assembly="*"/>
                                                   </assemblies>
                                               </compilation>
                                           </configuration>


                                      Note: Each assembly loaded from /bin is limited in scope to the application in which it is running. This means that
                                      peer applications could potentially use different assemblies with the same class or namespace names, without
                                      conflicting.

                                      A Simple Two-Tier Web Forms Page

                                      The classic use for an external component is to perform data access. This simplifies the code in your page, improving
                                      readability and separating your user interface (UI) logic from the system functionality. The following example
                                      demonstrates a simple two-tiered Web Forms page that uses a data access component to retrieve product
                                      information.




 http://samples.gotdotnet.com/quickstart/aspplus/doc/businessobjs.aspx (2 of 3) [4/02/2002 8:50:58 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                            VB TwoTier.aspx

                                            [Run Sample] | [View Source]


                                     The data access component takes a single parameter to its constructor specifying the connection string to the product
                                     database. The Web Forms page calls the component's GetCategories method to populate a drop-down list, and
                                     calls the component's GetProductsForCategory method to display the products for the category selected by the
                                     user.

                                     A Simple Three-Tier Web Forms Page

                                     A three-tiered application model extends the two-tiered scenario to include business rules between the UI and data
                                     access logic. This model allows UI developers to work with a higher level of abstraction rather than directly
                                     manipulating data through low-level data access component APIs. The middle business component typically enforces
                                     business rules and ensures that the relationships and primary key constraints of the database are honored. The
                                     following example uses the middle component to calculate a discount based on a two-digit Vendor ID entered by the
                                     client.




                                            VB ThreeTier.aspx

                                            [Run Sample] | [View Source]


                                     Section Summary

                                          1. The ASP.NET runtime finds business objects (local assemblies) in a well-known /bin directory, directly under
                                             the application root. The /bin directory offers the following advantages:


                                                    r   No registration required. No registration is required to make an assembly available to pages in
                                                        the application. It is available by virtue of its location in the /bin directory. Compiled code can be
                                                        deployed by simply copying or FTPing to this location.
                                                    r   No server restart required. When any part of an ASP.NET application is changed (for example,
                                                        when a DLL in /bin is replaced), new requests immediately begin execution against the changed file
                                                        or files. Currently executing requests are allowed to complete before the old application is
                                                        gracefully torn down. The Web server does not require a restart when you change your application,
                                                        even when replacing compiled code.
                                                    r   No namespace conflicts. Each assembly loaded from /bin is limited in scope to the application in
                                                        which it is running. This means that peer applications could potentially use different assemblies
                                                        with the same class or namespace names, without conflicting.


                                          2. Classes in an assembly are made available to a page in the application using an Import directive within the
                                             .aspx file.
                                          3. Two-tiered applications simplify the code in a page, improving readability and separating user interface (UI)
                                             logic from system functionality.
                                          4. Three-tiered applications extend the two-tiered model to enable UI developers to work with a higher level of
                                             abstraction. The middle business component typically enforces business rules and ensures that the
                                             relationships and primary key constraints of the database are honored.




http://samples.gotdotnet.com/quickstart/aspplus/doc/businessobjs.aspx (3 of 3) [4/02/2002 8:50:58 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                     Authoring Custom Controls
 Introduction
 What is ASP.NET?                           Developing a Simple Custom Control
 Language Support                           Defining Simple Properties
                                            Defining Class Properties
ASP.NET Web Forms                           Retrieving Inner Content
 Introducing Web Forms                      Developing a Composite Control
 Working with Server Controls               Handling Events in a Composite Control
 Applying Styles to Controls                Raising Events from a Composite Control
 Server Control Form Validation             Maintaining State
 Web Forms User Controls                    Developing a Custom (Non-Composite) Control that Handles Post-back Data
 Data Binding Server Controls               Generating Client-side JavaScript for Custom Post-back
 Server-Side Data Access                    Developing a Templated Control
 Data Access and Customization              Developing a Templated Databound Control
 Working with Business Objects              Overriding Control Parsing
 Authoring Custom Controls                  Defining a Custom Control Builder
 Web Forms Controls Reference
 Web Forms Syntax Reference
                                    This section of the QuickStart demonstrates how advanced developers can write their own ASP.NET server controls that work
                                    within the ASP.NET page framework. By writing your own custom ASP.NET server controls, you can encapsulate custom user
ASP.NET Web Services                interface and other functionality in controls that can be reused on ASP.NET pages. The QuickStart provides an introduction to
 Introducing Web Services           authoring custom controls through hands-on examples. For more information about control authoring, see Developing
 Writing a Simple Web Service       ASP.NET Server Controls in the Microsoft .NET Framework SDK documentation.
 Web Service Type Marshalling
 Using Data in Web Services         Note: The controls described in this section might not work correctly at design time in a forms designer such as Microsoft
                                    Visual Studio.NET, although they work properly at run time on ASP.NET pages. To work in a designer, a control needs to
 Using Objects and Intrinsics
                                    apply design-time attributes not described here. For details about the design-time attributes you need to apply, see Design-
 The WebService Behavior            Time Attributes for Components in the SDK documentation.
 HTML Pattern Matching
                                    Developing a Simple Custom Control
ASP.NET Web Applications
 Application Overview               It is easy to start authoring your own ASP.NET server controls. To create a simple custom control, all you have to do is to
 Using the Global.asax File         define a class that derives from System.Web.UI.Control and override its Render method. The Render method takes one
                                    argument of type System.Web.UI.HtmlTextWriter. The HTML that your control wants to send to the client is passed as a
 Managing Application State         string argument to the Write method of HtmlTextWriter.
 HttpHandlers and Factories
                                    The following example demonstrates a simple control that renders a message string.
Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration                              VB Simple.aspx
 Configuration Overview
 Configuration File Format                 [Run Sample] | [View Source]
 Retrieving Configuration


Deployment                          Defining Simple Properties
 Deploying Applications
 Using the Process Model            Properties are like "smart" fields that have accessor methods. You should expose properties instead of public fields from your
                                    controls because properties allow data hiding, can be versioned, and are supported by visual designers. Properties have
 Handling Errors                    get/set accessor methods that set and retrieve properties, and allow additional program logic to be performed if needed.


Security                            The following sample shows how to add simple properties that correspond to primitive data types such as integer, Boolean,
 Security Overview                  and string. The sample defines three properties - Message is of type string, MessageSize is of type enumeration, and
 Authentication & Authorization     Iterations is of type integer. Note the page syntax for setting simple and enumeration properties.

 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices

                                           VB SimpleProperty.aspx
Localization
 Internationalization Overview
                                           [Run Sample] | [View Source]
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files
                                    Defining Class Properties


 http://samples.gotdotnet.com/quickstart/aspplus/doc/webctrlauthoring.aspx (1 of 7) [4/02/2002 8:51:08 AM]
 Microsoft ASP.NET QuickStarts Tutorial


Tracing                             If a class A has a property whose type is class B, then the properties of B (if any) are called subproperties of A. The following
 Tracing Overview                   sample defines a custom control SimpleSubProperty that has a property of type Format. Format is a class that has two
 Trace Logging to Page Output       primitive properties - Color and Size, which in turn become subproperties of SimpleSubProperty.
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview                         VB SimpleSubProperty.aspx
 Performance Tuning Tips
 Measuring Performance                     [Run Sample] | [View Source]


ASP to ASP.NET Migration            Note that ASP.NET has a special syntax for setting subproperties. The following code example shows how to declaratively set
 Migration Overview                 the Format.Color and Format.Size subproperties on SimpleSubProperty. The "-" syntax denotes a subproperty.

 Syntax and Semantics
                                    <SimpleControlSamples:SimpleSubProperty Message="Hello There" Format-Color="red" Format-
 Language Compatibility
                                    Size="3" runat=server/>
 COM Interoperability
 Transactions
                                    Retrieving Inner Content
Sample Applications
 A Personalized Portal              Every control has a Controls property that it inherits from System.Web.UI.Control. This is a collection property that
 An E-Commerce Storefront           denotes the child controls (if any) of a control. If a control is not marked with the ParseChildrenAttribute or marked with
                                    ParseChildrenAttribute(ChildrenAsProperties = false), the ASP.NET page framework applies the following parsing logic
 A Class Browser Application        when the control is used declarartively on a page. If the parser encounters nested controls within the control's tags, it creates
 IBuySpy.com                        instances of them and adds them to the Controls property of the control. Literal text between tags is added as a
                                    LiteralControl. Any other nested elements generate a parser error.

Get URL for this page
                                    The following sample shows a custom control, SimpleInnerContent, that renders text added between its tags by checking
                                    if a LiteralControl has been added to its Controls collection. If so, it retrieves the Text property of the LiteralControl, and
                                    appends it to its output string.




                                              VB SimpleInnerContent.aspx

                                           [Run Sample] | [View Source]


                                    Note: If your custom control derives from WebControl, it will not have the parsing logic described in the sample, because
                                    WebControl is marked with ParseChildrenAttribute(ChildrenAsProperties = true), which results in a different parsing
                                    logic. For more information about the ParseChildrenAttribute, see the SDK documentation.



                                    Developing a Composite Control

                                    You can author new controls by combining existing controls using class composition. Composite controls are equivalent to
                                    user controls that are authored using ASP.NET page syntax. The main difference between user controls and composite
                                    controls is that user controls are persisted as .ascx text files, whereas composite controls are compiled and persisted in
                                    assemblies.


                                    The key steps in developing a composite control are:


                                          q   Override the protected CreateChildControls method inherited from Control to create instances of child controls
                                              and add them to the Controls collection.
                                          q   If new instances of your composite control will repeatedly be created on a page, implement the
                                              System.Web.UI.INamingContainer interface. This is a tagging interface that has no methods. When it is
                                              implemented by a control, the ASP.NET page framework creates a new naming scope under that control. This
                                              ensures that the child controls will have unique IDs in the hierarchical tree of controls.


                                    You do not have to override the Render method because child controls provide rendering logic. You can expose properties
                                    that synthesize properties of the child controls.


                                    The following sample defines a composite control, Composition1, that combines a System.Web.UI.LiteralControl and a
                                    System.Web.UI WebControls.TextBox. Composition1 exposes a custom property, Value, of type integer, that maps
                                    to the Text property of TextBox.




 http://samples.gotdotnet.com/quickstart/aspplus/doc/webctrlauthoring.aspx (2 of 7) [4/02/2002 8:51:08 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                             VB Composition1.aspx

                                          [Run Sample] | [View Source]



                                   Handling Events in a Composite Control

                                   A composite control can handle events raised by its child controls. This is accomplished by providing event handling methods
                                   and attaching delegates to the events raised by the child controls.


                                   The following sample shows a composite control, Composition2, that adds two button controls (named Add and
                                   Subtract) to the composite control from the previous example and provides event handling methods for the Click events of
                                   the buttons. These methods increment and decrement the Value property of Composition2. The CreateChildControls
                                   method of Composition2 creates instances of event handlers (delegates) that reference these methods, and attaches the
                                   delegates to the Click events of the Button instances. The end result is a control that does its own event handling - when
                                   the Add button is clicked, the value in the text box is incremented, and when the Subtract button is clicked, the value is
                                   decremented.




                                             VB Composition2.aspx

                                          [Run Sample] | [View Source]



                                   Raising Custom Events from a Composite Control

                                   A composite control can define custom events that it raises in response to events raised by its child controls.


                                   The following example shows a composite control, Composition3, that raises a custom event, Change, in response to the
                                   TextChanged event of the TextBox child control.


                                   This is accomplished as follows:


                                         q   The custom Change event is defined using the standard event pattern. (This pattern includes the definition of a
                                             protected OnChange method that raises the Change event.)



                                                  Public Event Change(Sender as Object, E as EventArgs)
                                                  Protected Sub OnChange(e As EventArgs)
                                                      Change(Me, e)
                                                  End Sub


                                             VB


                                         q   An event-handling method is defined for the TextChanged event of TextBox. This method raises the Change
                                             event by invoking the OnChange method.



                                                  Private Sub TextBox_Change(sender As Object, e As EventArgs)
                                                      OnChange(EventArgs.Empty)
                                                  End Sub


                                             VB


                                         q   The CreateChildControls method creates an instance of an event handler that references the above method, and
                                             attaches the event handler to the TextChanged event of the TextBox instance.



                                                  Protected Overrides Sub CreateChildControls()
                                                    ...
                                                    Dim box As New TextBox()
                                                    AddHandler Box.TextChanged, AddressOf TextBox_Change
                                                      ...


http://samples.gotdotnet.com/quickstart/aspplus/doc/webctrlauthoring.aspx (3 of 7) [4/02/2002 8:51:08 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                                 End Sub


                                            VB


                                   The Change event can be handled by a page that hosts the control, as shown in the following sample. In the sample, the
                                   page provides an event-handling method for the Change event that sets the Value property to zero if the number entered
                                   by the user is negative.




                                           VB Composition3.aspx

                                          [Run Sample] | [View Source]



                                   Maintaining State

                                   Every Web Forms control has a State property (inherited from Control) that enables it to participate in State management.
                                   The type of State is Sytem.Web.UI.StateBag, which is a data structure equivalent to a hashtable. A control can save data
                                   in State as key/value pairs. State is persisted to a string variable by the ASP.NET page framework and makes a round trip to
                                   the client as a hidden variable. Upon postback, the page framework parses the input string from the hidden variable and
                                   populates the State property of each control in the control hierarchy of a page. A control can restore its state (set properties
                                   and fields to their values before postback) using the State property. Control developers should be aware that there is a
                                   performance overhead in sending data by round trip to the client, and be judicious about what they save in State.


                                   The following code example shows a property that is saved in State.



                                         Public Property Text As String
                                           Get
                                             Return CType(State("Text"), String))
                                           End Get
                                           Set
                                             State("Text") = Value
                                           End Set
                                         End Property


                                   VB


                                   The following sample shows a custom control, Label, that has two properties, Text and FontSize, that are saved in
                                   State. The ASP.NET page that uses Label contains buttons that have event handlers to increase the font size of the text in
                                   Label when a button is clicked. Thus the font size increases every time a button is clicked. This is possible only due to state
                                   management - Label needs to know what the font size was before postback in order to render the next larger font size after
                                   postback.




                                           VB Label.aspx

                                          [Run Sample] | [View Source]



                                   Developing a Custom (Non-Composite) Control that Handles Postback Data

                                   You authored a simple custom control at the beginning of this QuickStart. The following example demonstrates a custom
                                   control that does something more meaningful - it renders an input box, and reads in data entered by the user. A control that
                                   examines postback (input) data must implement the System.Web.UI.IPostBackDataHandler interface. This signals to the
                                   ASP.NET page framework that a control should participate in postback data handling. The page framework passes input data
                                   to the LoadPostData method of this interface as key/value pairs. In its implementation of this method, the control can
                                   examine the input data and update its properties as shown below.



                                         Private _value As Integer = 0
                                         Public Function LoadPostData(postDataKey As String, values As NameValueCollection) As Boolean
                                             _value = Int32.Parse(values(Me.UniqueID))
                                             Return(False)
                                         End Function



http://samples.gotdotnet.com/quickstart/aspplus/doc/webctrlauthoring.aspx (4 of 7) [4/02/2002 8:51:08 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                   VB


                                   The following sample defines a custom control, NonComposition1, that implements IPostBackDataHandler and has one
                                   property, Value. The control renders an HTML input box whose text attribute is the string representation of Value. The
                                   property is set by examining postback input data. The page that uses NonComposition1 also has two buttons that have
                                   event handlers to increment and decrement the Value property of NonComposition1.




                                           VB NonComposition1.aspx

                                          [Run Sample] | [View Source]



                                   Generating Client-side JavaScript for Custom Postback

                                   If a control wants to capture postback events (form submissions from a client), it must implement the
                                   System.Web.UI.IPostBackEventHandler interface. This signals to the ASP.NET page framework that a control wants to
                                   be notified of a postback event. The RaisePostBackEvent method allows the control to handle the event, and to raise other
                                   events. Additionally, the ASP.NET page framework has a custom event architecture that allows a control to generate client-
                                   side JavaScript that initiates custom postback. Normally, postback is initiated by only a few elements such as a Submit button
                                   or an Image button. However, by emitting client-side JavaScript, a control can also initiate postback from other HTML
                                   elements.


                                   The following example defines a custom control, NonComposition2, that builds on the previous example,
                                   NonComposition1. In addition to the interface provided by NonComposition1, it renders two HtmlButtons that
                                   generate client-side JavaScript to cause postback when clicked. The name attributes of these buttons are Add and Subtract.
                                   The name attribute is passed as a string argument to RaisePostBackEvent by the page framework. NonComposition2
                                   implements RaisePostBackEvent to increment the Value property if Add is clicked and to decrement Value if Subtract is
                                   clicked, as shown below.



                                         Public Sub RaisePostBackEvent(eventArgument As String)
                                             If eventArgument = "Add" Then
                                                  Me.Value = Me.Value + 1
                                             Else
                                                  Me.Value = Me.Value - 1
                                             End If
                                         End Sub


                                   VB


                                   The user interface that is presented to the client is identical to that in the previous example; however, the entire UI is
                                   rendered by one custom control that also handles the postback events. The page developer can simply add
                                   NonComposition2 to the page, without providing any event handling logic. The following sample presents this code in
                                   action.




                                           VB NonComposition2.aspx

                                          [Run Sample] | [View Source]



                                   Developing a Templated Control

                                   The ASP.NET page framework allows control developers to author controls that separate the user interface from the control
                                   logic through the use of templates. Page developers can customize the presentation of the control by providing the UI as
                                   parameters between template tags.


                                   Templated controls have one or more properties of type System.Web.UI.ITemplate, as shown in the following example.



                                         Public Property <TemplateContainer(GetType(Template1VB))> MessageTemplate As ITemplate


                                   VB



http://samples.gotdotnet.com/quickstart/aspplus/doc/webctrlauthoring.aspx (5 of 7) [4/02/2002 8:51:08 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                   The attribute (in square brackets above) specifies the type of the container (parent) control.


                                   The ITemplate interface has one method, InstantiateIn, that creates a control instance dynamically. This is invoked on
                                   the ITemplate property in the CreateChildControls method, as shown in the following example.



                                         Protected Overrides Sub CreateChildControls()
                                             If MessageTemplate <> Null Then
                                                 MessageTemplate.InstantiateIn(Me)
                                             End if
                                             ...
                                         End Sub


                                   VB


                                   The following sample shows a simple templated control and an ASP.NET page that uses it.




                                           VB Template1.aspx

                                          [Run Sample] | [View Source]



                                   Developing a Templated Databound Control

                                   The following sample shows a more complex use of templates to create a databound control. The Repeater control defined in
                                   this example is similar to the System.Web.UI.WebControls.Repeater control.




                                           VB Repeater1.aspx

                                          [Run Sample] | [View Source]


                                   The following sample modifies the preceding sample so that a page consumer can walk its Items collection during postback to
                                   pull out values from it.




                                           VB Repeater2.aspx

                                          [Run Sample] | [View Source]



                                   Overriding Control Parsing

                                   As you saw in Retrieving Inner Content , if a control A has nested controls within its control tags on a page, the page parser
                                   adds instances of those controls to A's Controls collection. This is done by invoking the AddSubParsedObject method of A.
                                   Every control inherits this method from Control; the default implementation simply inserts a child control into the control
                                   hierarchy tree. A control can override the default parsing logic by overriding the AddSubParsedObject method. Note that
                                   this discussion is somewhat simplified; more details are given in the next example.


                                   The following sample defines a custom control, CustomParse1, that overrides the default parsing logic. When a child control
                                   of a certain type is parsed, it adds it to a collection. The rendering logic of CustomParse1 is based on the number of items
                                   in that collection. A simple custom control, Item, is also defined in the sample.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webctrlauthoring.aspx (6 of 7) [4/02/2002 8:51:08 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                           VB CustomParse1.aspx

                                          [Run Sample] | [View Source]


                                   Note: If your custom control derives from WebControl, it will not have the parsing logic described in the sample, because
                                   WebControl is marked with ParseChildrenAttribute(ChildrenAsProperties = true), which results in a different parsing
                                   logic. For more information about the ParseChildrenAttribute, see the SDK documentation. The Retrieving Inner Content
                                   topic also describes this issue in more detail.



                                   Defining a Custom Control Builder

                                   The ASP.NET page framework uses classes called control builders to process the declarations within control tags on a page.
                                   Every Web Forms control is associated with a default control builder class, System.Web.UI.ControlBuilder. The default
                                   control builder adds a child control to the Controls collection for every nested control that it encounters within control tags.
                                   Additionally, it adds Literal controls for text between nested control tags. You can override this default behavior by
                                   associating a custom control builder class with your control. This is done by applying a control builder attribute to your
                                   control, as shown in the following example.



                                         Public Class <ControlBuilderAttribute(GetType(CustomParse2ControlBuilderVB))> _
                                           CustomParse2VB : Inherits Control


                                   VB


                                   The element in square brackets above is a common language runtime attribute that associates the
                                   CustomParse2ControlBuilder class with the CustomParse2 control. You can define your own custom control builder
                                   by deriving from ControlBuilder and overriding its methods.


                                   The following sample defines a custom control builder that overrides the GetChildControlType method inherited from
                                   ControlBuilder. This method returns the type of the control to be added and can be used to decide which controls will be
                                   added. In the example, the control builder will add a child control only if the tag name is "customitem". The code for the
                                   control is very similar to the previous example, except for the addition of the custom attribute.




                                           VB CustomParse2.aspx

                                          [Run Sample] | [View Source]




http://samples.gotdotnet.com/quickstart/aspplus/doc/webctrlauthoring.aspx (7 of 7) [4/02/2002 8:51:08 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Web Forms Controls Reference
 Introduction
 What is ASP.NET?                                 System.Web.UI.HtmlControls
 Language Support                                 System.Web.UI.WebControls


ASP.NET Web Forms
 Introducing Web Forms                    System.Web.UI.HtmlControls
 Working with Server Controls
 Applying Styles to Controls              HTML server controls are HTML elements exposed to the server so you can program against them.
 Server Control Form Validation           HTML server controls expose an object model that maps very closely to the HTML elements that
                                          they render.
 Web Forms User Controls
 Data Binding Server Controls
                                          HtmlAnchor                HtmlButton             HtmlForm               HtmlGenericControl
 Server-Side Data Access
                                                                    HtmlInputButton        HtmlInputButton        HtmlInputButton
 Data Access and Customization            HtmlImage
                                                                    (Button)               (Reset)                (Submit)
 Working with Business Objects
                                          HtmlInputCheckBox         HtmlInputFile          HtmlInputHidden        HtmlInputImage
 Authoring Custom Controls
                                                               HtmlInputText               HtmlInputText
 Web Forms Controls Reference             HtmlInputRadioButton                                                    HtmlSelect
                                                               (Password)                  (Text)
 Web Forms Syntax Reference
                                          HtmlTable                 HtmlTableCell          HtmlTableRow           HtmlTextArea

ASP.NET Web Services
                                          System.Web.UI.WebControls
 Introducing Web Services
 Writing a Simple Web Service
                                          Web server controls are ASP.NET server controls with an abstract, strongly-typed object model.
 Web Service Type Marshalling
                                          Web server controls include not only form-type controls such as buttons and text boxes, but also
 Using Data in Web Services               special-purpose controls such as a calendar. Web server controls are more abstract than HTML
 Using Objects and Intrinsics             server controls, in that their object model does not necessarily reflect HTML syntax.
 The WebService Behavior
 HTML Pattern Matching                    AdRotator              Button                         Calendar           CheckBox
                                          CheckBoxList           CompareValidator               CustomValidator DataGrid
                                          DataList               DropDownList                   HyperLink          Image
ASP.NET Web Applications
 Application Overview                     ImageButton            Label                          LinkButton         ListBox
 Using the Global.asax File               Panel                  PlaceHolder                    RadioButton        RadioButtonList
 Managing Application State               RangeValidator         RegularExpressionValidator Repeater               RequiredFieldValidator
 HttpHandlers and Factories               Table                  TableCell                      TableRow           TextBox
                                          ValidationSummary XML

Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model
 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication



 http://samples.gotdotnet.com/quickstart/aspplus/doc/webcontrolsref.aspx (1 of 2) [4/02/2002 8:51:10 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




 http://samples.gotdotnet.com/quickstart/aspplus/doc/webcontrolsref.aspx (2 of 2) [4/02/2002 8:51:10 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Web Forms Syntax Reference
 Introduction
 What is ASP.NET?                                 ASP.NET Web Forms Syntax Elements
 Language Support                                 Rendering Code Syntax
                                                  Declaration Code Syntax
ASP.NET Web Forms                                 ASP.NET Server Control Syntax
 Introducing Web Forms                            ASP.NET Html Server Control Syntax
 Working with Server Controls                     Databinding Syntax
 Applying Styles to Controls                      Object Tag Syntax
 Server Control Form Validation                   Server Side Comment Syntax
 Web Forms User Controls                          Server Side Include Syntax
 Data Binding Server Controls
 Server-Side Data Access
 Data Access and Customization            ASP.NET Web Forms Syntax Elements
 Working with Business Objects
 Authoring Custom Controls                An ASP.NET Web Forms page is a declarative text file with an .aspx file name extension. In
 Web Forms Controls Reference             addition to static content, you can use eight distinct syntax markup elements. This section of the
                                          QuickStart reviews each of these syntax elements and provides examples demonstrating their
 Web Forms Syntax Reference               use.

                                          Rendering Code Syntax: <% %> and <%= %>
ASP.NET Web Services
 Introducing Web Services
                                          Code rendering blocks are denoted with <% ... %> elements, allow you to custom-control
 Writing a Simple Web Service
                                          content emission, and execute during the render phase of Web Forms page execution. The
 Web Service Type Marshalling             following example demonstrates how you can use them to loop over HTML content.
 Using Data in Web Services
 Using Objects and Intrinsics
                                               <% For I=0 To 7 %>
 The WebService Behavior
                                                    <font size="<%=i%>"> Hello World! </font> <br>
 HTML Pattern Matching                         <% Next %>


ASP.NET Web Applications                  VB
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview                                 VB Reference1.aspx
 Page Output Caching
 Page Fragment Caching                           [Run Sample] | [View Source]
 Page Data Caching
                                          Code enclosed by <% ... %> is just executed, while expressions that include an equal sign,
Configuration                             <%= ... %>, are evaluated and the result is emitted as content. Therefore
                                          <%="Hello World" %> renders the same thing as the C# code
 Configuration Overview
                                          <% Response.Write("Hello World"); %>.
 Configuration File Format
 Retrieving Configuration
                                          Note: For languages that utilize marks to end or separate statements (for example, the
                                          semicolon (;) in C#), it is important to place those marks correctly depending on how your code
                                          should be rendered.
Deployment
 Deploying Applications
 Using the Process Model                        C# code
 Handling Errors                                      <% Response.Write("Hello                A semicolon is necessary to end the
                                                      World"); %>                             statement.
Security                                              <%="Hello World"; %>                    Wrong: Would result in
 Security Overview                                                                            "Response.Write("Hello
                                                                                              World";);".
 Authentication & Authorization
 Windows-based Authentication


 http://samples.gotdotnet.com/quickstart/aspplus/doc/webformssyntaxref.aspx (1 of 5) [4/02/2002 8:51:13 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Forms-based Authentication                           <%="Hello World" %>                    A semicolon is not necessary.
 Authorizing Users and Roles
 User Account Impersonation
                                          Declaration Code Syntax: <script runat="server">
 Security and WebServices

                                          Code declaration blocks define member variables and methods that will be compiled into the
Localization                              generated Page class. These blocks can be used to author page/navigation logic. The following
 Internationalization Overview            example demonstrates how a Subtract method can be declared within a <script
 Setting Culture and Encoding             runat="server"> block, and then invoked from the page.

 Localizing ASP.NET Applications
 Working with Resource Files                   <script language="VB" runat=server>
                                               Function Subtract(num1 As Integer, num2 As Integer) As Integer
                                                 Return(num1 - num2)
Tracing                                        End Function
 Tracing Overview                              </script>
 Trace Logging to Page Output
                                               <%
 Application-level Trace Logging                  ...
                                                  number = subtract(number, 1)
                                                  ...
Debugging                                      %>
 The SDK Debugger

                                          VB
Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
                                                 VB Reference2.aspx
 Syntax and Semantics
 Language Compatibility                          [Run Sample] | [View Source]
 COM Interoperability
 Transactions
                                          Important: Unlike ASP -- where functions could be declared within <% %> blocks -- all
                                          functions and global page variables must be declared in a <script runat=server> tag.
Sample Applications                       Functions declared within <% %> blocks will now generate a syntax compile error.
 A Personalized Portal
                                          ASP.NET Server Control Syntax
 An E-Commerce Storefront
 A Class Browser Application              Custom ASP.NET server controls enable page developers to dynamically generate HTML user
 IBuySpy.com                              interface (UI) and respond to client requests. They are represented within a file using a
                                          declarative, tag-based syntax. These tags are distinguished from other tags because they contain
                                          a "runat=server" attribute. The following example demonstrates how an <asp:label
 Get URL for this page                    runat="server"> server control can be used within an ASP.NET page. This control corresponds
                                          to the Label class in the System.Web.UI.WebControls namespace, which is included by
                                          default.


                                          By adding a tag with the ID "Message", an instance of Label is created at run time:


                                               <asp:label id="Message" font-size=24 runat="server"/>


                                          The control can then be accessed using the same name. The following line sets the Text
                                          property of the control.



                                               Message.Text = "Welcome to ASP.NET"


                                          VB




 http://samples.gotdotnet.com/quickstart/aspplus/doc/webformssyntaxref.aspx (2 of 5) [4/02/2002 8:51:13 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                 VB Reference3.aspx

                                                [Run Sample] | [View Source]


                                         ASP.NET HTML Server Control Syntax

                                         HTML server controls enable page developers to programmatically manipulate HTML elements
                                         within a page. An HTML server control tag is distinguished from client HTML elements by means
                                         of a "runat=server" attribute. The following example demonstrates how an HTML <span
                                         runat=server> server control can be used within an ASP.NET page.


                                         As with other server controls, the methods and properties are accessible programmatically, as
                                         shown in the following example.



                                              <script language="VB" runat="server">
                                                Sub Page_Load(sender As Object, e As EventArgs)
                                                  Message.InnerHtml = "Welcome to ASP.NET"
                                                End Sub
                                              </script>
                                              ...
                                              <span id="Message" style="font-size:24" runat="server"/>


                                         VB




                                                 VB Reference4.aspx

                                                [Run Sample] | [View Source]


                                         Data Binding Syntax: <%# %>

                                         The data binding support built into ASP.NET enables page developers to hierarchically bind
                                         control properties to data container values. Code located within a <%# %> code block is only
                                         executed when the DataBind method of its parent control container is invoked. The following
                                         example demonstrates how to use the data binding syntax within an <asp:datalist
                                         runat=server> control.


                                         Within the datalist, the template for one item is specified. The content of the item template is
                                         specified using a data binding expression and the Container.DataItem refers to the data
                                         source used by the datalist MyList.


                                              <asp:datalist id="MyList" runat=server>
                                                <ItemTemplate>
                                                  Here is a value: <%# Container.DataItem %>
                                                </ItemTemplate>
                                              </asp:datalist>


                                         In this case the data source of the MyList control is set programmatically, and then
                                         DataBind() is called.




http://samples.gotdotnet.com/quickstart/aspplus/doc/webformssyntaxref.aspx (3 of 5) [4/02/2002 8:51:13 AM]
Microsoft ASP.NET QuickStarts Tutorial


                                              Sub Page_Load(sender As Object, e As EventArgs)
                                                Dim items As New ArrayList()

                                                 items.Add("One")
                                                 items.Add("Two")
                                                 items.Add("Three")

                                                MyList.DataSource = items
                                                MyList.DataBind()
                                              End Sub


                                         VB


                                         Calling the DataBind method of a control causes a recursive tree walk from that control on
                                         down in the tree; the DataBinding event is raised on each server control in that hierarchy, and
                                         data binding expressions on the control are evaluated accordingly. So, if the DataBind method
                                         of the page is called, then every data binding expression within the page will be called.




                                                VB Reference5.aspx

                                                [Run Sample] | [View Source]


                                         Object Tag Syntax: <object runat="server" />

                                         Object tags enable page developers to declare and create instances of variables using a
                                         declarative, tag-based syntax. The following example demonstrates how the object tag can be
                                         used to create an instance of an ArrayList class.


                                              <object id="items" class="System.Collections.ArrayList" runat="server"/>


                                         The object will be created automatically at run time and can then be accessed through the ID
                                         "items".



                                              Sub Page_Load(sender As Object, e As EventArgs)
                                                items.Add("One")
                                                items.Add("Two")
                                                items.Add("Three")
                                                ...
                                              End Sub


                                         VB




                                                VB Reference6.aspx

                                                [Run Sample] | [View Source]


                                         Server-Side Comment Syntax: <%-- Comment --%>



http://samples.gotdotnet.com/quickstart/aspplus/doc/webformssyntaxref.aspx (4 of 5) [4/02/2002 8:51:13 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                         Server-side comments enable page developers to prevent server code (including server controls)
                                         and static content from executing or rendering. The following sample demonstrates how to block
                                         content from executing and being sent down to a client. Note that everything between <%-- and
                                         --%> is filtered out and only visible in the original server file, even though it contains other
                                         ASP.NET directives.



                                              <%--
                                                <asp:calendar id="MyCal" runat=server/>
                                                   <% For I=0 To 44 %>
                                                            Hello World <br>
                                                   <% Next %>
                                              --%>


                                         VB




                                                VB Reference7.aspx

                                                [Run Sample] | [View Source]


                                         Server-Side Include Syntax: <-- #Include File="Locaton.inc" -->

                                         Server-side #Includes enable developers to insert the raw contents of a specified file anywhere
                                         within an ASP.NET page. The following sample demonstrates how to insert a custom header and
                                         footer within a page.


                                              <!-- #Include File="Header.inc" -->
                                              ...
                                              <!-- #Include File="Footer.inc" -->




                                                VB Reference8.aspx

                                                [Run Sample] | [View Source]




http://samples.gotdotnet.com/quickstart/aspplus/doc/webformssyntaxref.aspx (5 of 5) [4/02/2002 8:51:13 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                Introducing Web Services
 Introduction
 What is ASP.NET?                              The Internet is quickly evolving from today's Web sites that just deliver user
                                               interface pages to browsers to a next generation of programmable Web sites
 Language Support
                                               that directly link organizations, applications, services, and devices with one
                                               another. These programmable Web sites become more than passively accessed
ASP.NET Web Forms                              sites - they become reusable, intelligent Web Services.
 Introducing Web Forms
 Working with Server Controls                  The common language runtime provides built-in support for creating and
                                               exposing Web Services, using a programming abstraction that is consistent and
 Applying Styles to Controls                   familiar to both ASP.NET Web Forms developers and existing Visual Basic users.
 Server Control Form Validation                The resulting model is both scalable and extensible, and embraces open Internet
 Web Forms User Controls                       standards (HTTP, XML, SOAP, WSDL) so that it can be accessed and consumed
                                               from any client or Internet-enabled device.
 Data Binding Server Controls
 Server-Side Data Access
                                               ASP.NET Web Services
 Data Access and Customization
 Working with Business Objects
                                               ASP.NET provides support for Web Services with the .asmx file. An .asmx file is a
 Authoring Custom Controls                     text file that is similar to an .aspx file. These files can be part of an ASP.NET
 Web Forms Controls Reference                  application that includes .aspx files. These files are then URI-addressable, just as
 Web Forms Syntax Reference                    .aspx files are.


                                               The following example shows a very simple .asmx file.
ASP.NET Web Services
 Introducing Web Services
 Writing a Simple Web Service                        <%@ WebService Language="VB" Class="HelloWorld" %>
 Web Service Type Marshalling
                                                     Imports System
 Using Data in Web Services                          Imports System.Web.Services
 Using Objects and Intrinsics
                                                     Public Class HelloWorld :Inherits WebService
 The WebService Behavior
 HTML Pattern Matching                                      <WebMethod()> Public Function SayHelloWorld() As String
                                                                 Return("Hello World")
                                                            End Function
ASP.NET Web Applications
 Application Overview                                End Class

 Using the Global.asax File
 Managing Application State                    VB

 HttpHandlers and Factories
                                               This file starts with an ASP.NET directive WebService, and sets the language to
                                               C#, Visual Basic, or JScript. Next, it imports the namespace
Cache Services                                 System.Web.Services. You must include this namespace. Next, the class
 Caching Overview                              HelloWorld is declared. This class is derived from the base class WebService;
                                               note that deriving from the WebService base class is optional. Finally, any
 Page Output Caching                           methods that will be accessible as part of the service have the attribute
 Page Fragment Caching                         [WebMethod] in C#, <WebMethod()> in Visual Basic, or
 Page Data Caching                             WebMethodAttribute in JScript, in front of their signatures.


                                               To make this service available, we might name the file HelloWorld.asmx and
Configuration                                  place it on a server called SomeDomain.com inside a virtual directory called
 Configuration Overview                        someFolder. Using a Web browser, you could then enter the URL
 Configuration File Format                     http://SomeDomain.com/someFolder/HelloWorld.asmx, and the
                                               resulting page would show the public methods for this Web Service (those
 Retrieving Configuration
                                               marked with the WebMethod attribute), as well as which protocols (such as
                                               SOAP, or HTTP GET) you can use to invoke these methods.
Deployment
 Deploying Applications                        Entering the address:
 Using the Process Model                       http://SomeDomain.com/someFolder/HelloWorld.asmx?WSDL into the


http://samples.gotdotnet.com/quickstart/aspplus/doc/webservicesintro.aspx (1 of 2) [4/02/2002 8:51:15 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors                               browser returns a Web Service Description Language (WSDL) document. This
                                               WSDL document is very important, and is used by clients that will access the
                                               service.
Security
 Security Overview                             Accessing Web Services
 Authentication & Authorization
 Windows-based Authentication
                                               In addition to the ASP.NET server side technology that allows developers to
 Forms-based Authentication                    create Web Services, the .NET Framework provides a sophisticated set of tools
 Authorizing Users and Roles                   and code to consume Web Services. Because Web Services are based on open
                                               protocols such as the Simple Object Access Protocol (SOAP), this client
 User Account Impersonation                    technology can also be used to consume non-ASP.NET Web Services.
 Security and WebServices
                                               Within the SDK, there is a tool called the Web Services Description Language tool
Localization                                   (WSDL.exe). This command-line tool is used to create proxy classes from WSDL.
                                               For example, you could enter:
 Internationalization Overview
 Setting Culture and Encoding
                                                     WSDL http://someDomain.com/someFolder/HelloWorld.asmx?WSDL
 Localizing ASP.NET Applications
 Working with Resource Files
                                               to create a proxy class called HelloWorld.cs.

Tracing                                        This class would look very similar to the class created in the previous section. It
 Tracing Overview                              would contain a method called SayHelloWorld that returns a string. Compiling
 Trace Logging to Page Output                  this proxy class into an application and then calling this proxy class's method
                                               results in the proxy class packaging a SOAP request across HTTP and receiving
 Application-level Trace Logging
                                               the SOAP-encoded response, which is then marshaled as a string.

Debugging                                      From the client perspective, the code would be simple, as shown in the following
 The SDK Debugger                              example.


Performance                                          Dim myHelloWorld As New HelloWorld()
 Performance Overview                                Dim sReturn As String = myHelloWorld.SayHelloWorld()
 Performance Tuning Tips
 Measuring Performance                         VB


ASP to ASP.NET Migration                       The return would be "Hello World".
 Migration Overview
 Syntax and Semantics                          The rest of this section deals with more advanced Web Services topics, such as
                                               sending and receiving complex data types. There is also a section on Text
 Language Compatibility
                                               Pattern Matching, a technology that addresses any URI that returns text as if it
 COM Interoperability                          were a Web Service. You can also perform data binding operations with Web
 Transactions                                  Services; this topic is discussed in the Data section.


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/webservicesintro.aspx (2 of 2) [4/02/2002 8:51:15 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Write a Simple Web Service
 Introduction
 What is ASP.NET?                         You can write a simple Web Service in a few minutes using any text editor. The service you will in
                                          this section, MathService, exposes methods for adding, subtracting, dividing, and multiplying two
 Language Support
                                          numbers. At the top of the page, the following directive identifies the file as a Web Service in addition
                                          to specifying the language for the service (C#, in this case).
ASP.NET Web Forms
 Introducing Web Forms                         <%@ WebService Language="C#" Class="MathService" %>
 Working with Server Controls
 Applying Styles to Controls              In this same file, you define a class that encapsulates the functionality of your service. This class
                                          should be public, and can optionally inherit from the WebService base class. Each method that will
 Server Control Form Validation
                                          be exposed from the service is flagged with a [WebMethod] attribute in front of it. Without this
 Web Forms User Controls                  attribute, the method will not be exposed from the service. This is sometimes useful for hiding
 Data Binding Server Controls             implementation details called by public Web Service methods, or in the case where the
                                          WebService class is also used in local applications (a local application can use any public class, but
 Server-Side Data Access
                                          only WebMethod classes are remotely accessible as Web Services).
 Data Access and Customization
 Working with Business Objects
 Authoring Custom Controls                     Imports System
                                               Imports System.Web.Services
 Web Forms Controls Reference
 Web Forms Syntax Reference                    Public Class MathService : Inherits WebService

                                                    <WebMethod()> Public Function Add(a As Integer, b As Integer) As Integer
ASP.NET Web Services                                    Return(a + b)
 Introducing Web Services                           End Function
 Writing a Simple Web Service                  End Class
 Web Service Type Marshalling
 Using Data in Web Services               VB
 Using Objects and Intrinsics
 The WebService Behavior                  Web Service files are saved under the .asmx file extension. Like .aspx files, these are automatically
 HTML Pattern Matching                    compiled by the ASP.NET runtime when a request to the service is made (subsequent requests are
                                          serviced by a cached precompiled type object). In the case of MathService, you have defined the
                                          WebService class in the .asmx file itself. Note that if an .asmx file is requested by a browser, the
ASP.NET Web Applications                  ASP.NET runtime returns a Web Service Help page that describes the Web Service.
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview                                 VB MathService.asmx                            VB MathService.asmx?wsdl
 Page Output Caching
 Page Fragment Caching                            [Run Sample] | [View Source]                   [View Sample]
 Page Data Caching

                                          Precompiled Web Services
Configuration
 Configuration Overview
                                          If you have a precompiled class that you want to expose as a Web Service (and this class exposes
 Configuration File Format                methods marked with the [WebMethod] attribute), you can create an .asmx file with only the
 Retrieving Configuration                 following line.


Deployment                                     <%@ WebService Class="MyWebApplication.MyWebService" %>
 Deploying Applications
 Using the Process Model                  MyWebApplication.MyWebService defines the WebService class, and is contained in the \bin
                                          subdirectory of the ASP.NET application.
 Handling Errors

                                          Consuming a Web Service from a Client Application
Security
 Security Overview
                                          To consume this service, you need to use the Web Services Description Language command-line tool
 Authentication & Authorization           (WSDL.exe) included in the SDK to create a proxy class that is similar to the class defined in the
 Windows-based Authentication             .asmx file. (It will contain only the WebMethod methods.) Then, you compile your code with this
 Forms-based Authentication               proxy class included.



 http://samples.gotdotnet.com/quickstart/aspplus/doc/writingservices.aspx (1 of 2) [4/02/2002 8:51:17 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Authorizing Users and Roles              WSDL.exe accepts a variety of command-line options, however to create a proxy only one option is
 User Account Impersonation               required: the URI to the WSDL. In this example, we are passing a few extra options that specify the
                                          preferred language, namespace, and output location for the proxy. We are also compiling against a
 Security and WebServices
                                          previously saved WSDL file instead of the URI to the service itself:

Localization                                   wsdl.exe /l:CS /n:MathService /out:MathService.cs MathService.wsdl
 Internationalization Overview
 Setting Culture and Encoding             Once the proxy class exists, you can create objects based on it. Each method call made with the
 Localizing ASP.NET Applications          object then goes out to the URI of the Web Service (usually as a SOAP request).
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging
                                                 VB MathServiceClient.aspx
Debugging
 The SDK Debugger
                                                 [Run Sample] | [View Source]


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




 http://samples.gotdotnet.com/quickstart/aspplus/doc/writingservices.aspx (2 of 2) [4/02/2002 8:51:17 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Web Service Type Marshaling
 Introduction
 What is ASP.NET?                                    This section illustrates that various data types can be passed to and
                                                     returned from Web Service methods. Because the Web Services
 Language Support
                                                     implementation is built on top of the XML Serialization architecture, it
                                                     supports a significant number of data types. The following table lists the
ASP.NET Web Forms                                    supported data types for Web Service methods when using the SOAP
                                                     protocol (for example, using the proxy generated by the Web Services
 Introducing Web Forms                               Description Language tool, WSDL.exe).
 Working with Server Controls
 Applying Styles to Controls
                                                            Type                            Description
 Server Control Form Validation
 Web Forms User Controls                                    Primitive Types                 Standard primitive types.
                                                                                            The complete list of
 Data Binding Server Controls                                                               supported primitives are
 Server-Side Data Access                                                                    String, Char, Byte,
 Data Access and Customization                                                              Boolean, Int16, Int32,
                                                                                            Int64, UInt16, UInt32,
 Working with Business Objects                                                              UInt64, Single, Double,
 Authoring Custom Controls                                                                  Guid, Decimal, DateTime
 Web Forms Controls Reference                                                               (as XML's timeInstant),
                                                                                            DateTime (as XML's date),
 Web Forms Syntax Reference                                                                 DateTime (as XML's time),
                                                                                            and XmlQualifiedName (as
                                                                                            XML's QName).
ASP.NET Web Services
 Introducing Web Services                                   Enum Types                      Enumeration types, for
                                                                                            example, "public enum
 Writing a Simple Web Service
                                                                                            color { red=1, blue=2 }"
 Web Service Type Marshalling
                                                            Arrays of Primitives,           Arrays of the above
 Using Data in Web Services
                                                            Enums                           primitives, such as string[]
 Using Objects and Intrinsics                                                               and int[]
 The WebService Behavior
                                                            Classes and Structs             Class and struct types with
 HTML Pattern Matching                                                                      public fields or properties.
                                                                                            The public properties and
                                                                                            fields are serialized.
ASP.NET Web Applications
 Application Overview                                       Arrays of Classes               Arrays of the above.
                                                            (Structs)
 Using the Global.asax File
 Managing Application State                                 DataSet                         ADO.NET DataSet Types
                                                                                            (see the next section for
 HttpHandlers and Factories                                                                 an example). DataSets
                                                                                            can also appear as fields
                                                                                            in structs or classes.
Cache Services
 Caching Overview
                                                                                            Note: Microsoft Visual
 Page Output Caching
                                                                                            Studio.NET and the
 Page Fragment Caching                                                                      XSD.EXE SDK utility have
 Page Data Caching                                                                          support for "strong-
                                                                                            typing" a DataSet. These
                                                                                            tools generate a class that
Configuration                                                                               inherits from DataSet to
 Configuration Overview                                                                     produce DataSet1, adding
                                                                                            several
 Configuration File Format                                                                  methods/properties/etc
 Retrieving Configuration                                                                   that are specific to a
                                                                                            particular XML schema. If
                                                                                            you pass DataSet, Web
Deployment                                                                                  Services always transmits
 Deploying Applications                                                                     the schema along with the
                                                                                            data (so it knows what
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/webservicetypes.aspx (1 of 4) [4/02/2002 8:51:19 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors                                                                            tables and columns you
                                                                                            are passing), and their
                                                                                            types (for example, int,
Security                                                                                    string). If you pass a
 Security Overview                                                                          subclass of DataSet (for
                                                                                            example, DataSet1), Web
 Authentication & Authorization                                                             Services assumes you are
 Windows-based Authentication                                                               adding tables/columns in
 Forms-based Authentication                                                                 the constructor, and
                                                                                            assumes that those
 Authorizing Users and Roles                                                                tables/columns represent
 User Account Impersonation                                                                 your schema.
 Security and WebServices                                   Arrays of DataSet               Arrays of the above.
                                                            XmlNode                         XmlNode is an in-memory
Localization                                                                                representation of an XML
 Internationalization Overview                                                              fragment (like a
                                                                                            lightweight XML document
 Setting Culture and Encoding
                                                                                            object model). For
 Localizing ASP.NET Applications                                                            example,
 Working with Resource Files                                                                "<comment>This
                                                                                            is<b>pretty</b>
                                                                                            neat</comment>" could
Tracing                                                                                     be stored in an XmlNode.
 Tracing Overview                                                                           You can pass XmlNodes as
                                                                                            parameters, and they are
 Trace Logging to Page Output
                                                                                            added to the rest of the
 Application-level Trace Logging                                                            XML being passed to the
                                                                                            Web Service (the other
                                                                                            parameters) in a SOAP-
Debugging                                                                                   compliant manner. The
 The SDK Debugger                                                                           same is true for return
                                                                                            values. This allows you to
                                                                                            pass or return XML whose
Performance                                                                                 structure changes from
 Performance Overview                                                                       call to call, or where you
                                                                                            may not know all the
 Performance Tuning Tips
                                                                                            types being passed.
 Measuring Performance                                                                      XmlNode can also appear
                                                                                            as fields in structs or
                                                                                            classes.
ASP to ASP.NET Migration
 Migration Overview                                         Arrays of XmlNode               Arrays of above.
 Syntax and Semantics
 Language Compatibility                                    Return values:
 COM Interoperability
 Transactions                                              Whether calling a Web Service using SOAP or HTTP GET/POST, all
                                                           the above types are supported for return values.

Sample Applications
                                                           Parameters:
 A Personalized Portal
 An E-Commerce Storefront
                                                           Both by-value and by-reference (in/out) parameters are supported
 A Class Browser Application                               when using the SOAP protocol. By-reference parameters can send the
 IBuySpy.com                                               value both ways: up to the server, and back to the client. When
                                                           passing input parameters to a Web Service using HTTP GET/POST,
                                                           only a limited set of data types are supported, and they must be by-
 Get URL for this page                                     value parameters. The supported types for HTTP GET/POST
                                                           parameters are listed below:


                                                           Type                                            Description



http://samples.gotdotnet.com/quickstart/aspplus/doc/webservicetypes.aspx (2 of 4) [4/02/2002 8:51:19 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                                           Primitive Types (limited)                       Most standard
                                                                                                           primitive types.
                                                                                                           The complete list
                                                                                                           of supported
                                                                                                           primitives are
                                                                                                           Int32, String,
                                                                                                           Int16, Int64,
                                                                                                           Boolean, Single,
                                                                                                           Double, Decimal,
                                                                                                           DateTime,
                                                                                                           UInt16, UInt32,
                                                                                                           UInt64, and
                                                                                                           Currency. From
                                                                                                           the client's
                                                                                                           perspective, all
                                                                                                           these types turn
                                                                                                           into string.
                                                           Enum Types                                      Enumeration
                                                                                                           types, for
                                                                                                           example, "public
                                                                                                           enum color {
                                                                                                           red=1, blue=2
                                                                                                           }". From the
                                                                                                           client's
                                                                                                           perspective,
                                                                                                           enums become
                                                                                                           classes with a
                                                                                                           static const
                                                                                                           string for each
                                                                                                           value.
                                                           Arrays of Primitives, Enums                     Arrays of the
                                                                                                           above primitives,
                                                                                                           such as string[]
                                                                                                           and int[]


                                                     The following example demonstrates the use of the types listed above,
                                                     using a SOAP proxy generated from WSDL.exe. Note that because there is
                                                     more than one public class defined in the .asmx file, you must specify
                                                     which is to be treated as the WebService class using the "Class" attribute
                                                     of the WebService directive:


                                                           <%@ WebService Language="C#" Class="DataTypes" %>




                                                                VB DataTypes.asmx                   VB
                                                                                                    DataTypes.asmx?wsdl
                                                                [Run Sample] |
                                                                [View Source]                       [View Sample]


                                                            q   The SayHello method shows returning a String from a service.
                                                            q   The SayHelloName method returns a String, and also takes a
                                                                String as a parameter.
                                                            q   The GetIntArray method shows how to return an array of



http://samples.gotdotnet.com/quickstart/aspplus/doc/webservicetypes.aspx (3 of 4) [4/02/2002 8:51:19 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                                                integers.
                                                            q   The GetMode method returns an enum value.
                                                            q   The GetOrder method returns a class (which is almost the same
                                                                as a struct here).
                                                            q   The GetOrders method returns an array of Order objects.


                                                     Using the WSDL.exe command line proxy generation tool, the marshaling
                                                     of these data types is transparent to the consuming client application. A
                                                     sample client application for the above Web Service follows:




                                                                VB DataTypesClient.aspx

                                                            [Run Sample] | [View Source]




http://samples.gotdotnet.com/quickstart/aspplus/doc/webservicetypes.aspx (4 of 4) [4/02/2002 8:51:19 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Use Data in Web Services
 Introduction
 What is ASP.NET?                                    This sample shows how DataSets, a powerful new XML-based way to
                                                     represent disconnected data, can be returned from a Web Service
 Language Support
                                                     method. This is an extremely powerful use of Web Services, as DataSets
                                                     can store complex information and relationships in an intelligent structure.
ASP.NET Web Forms                                    By exposing DataSets through a service, you can limit the database
                                                     connections your data server is experiencing.
 Introducing Web Forms
 Working with Server Controls
                                                     The method GetTitleAuthors connects to a database and issues two SQL
 Applying Styles to Controls                         statements: one that returns a list of authors, and another that returns a
 Server Control Form Validation                      list of book titles. It places both result sets into a single DataSet called ds,
 Web Forms User Controls                             and returns this DataSet.

 Data Binding Server Controls
                                                     The method PutTitleAuthors illustrates a Web Service method that
 Server-Side Data Access
                                                     takes a DataSet as a parameter, returning an integer that represents the
 Data Access and Customization                       number of rows received in the "Authors" table of the DataSet. Although
 Working with Business Objects                       the implementation of this method is somewhat simplistic, this method
                                                     could also intelligently merge the passed data with the database server.
 Authoring Custom Controls
 Web Forms Controls Reference
 Web Forms Syntax Reference


ASP.NET Web Services
 Introducing Web Services
 Writing a Simple Web Service
 Web Service Type Marshalling                                 VB
                                                              DataService.asmx                     VB
 Using Data in Web Services                                                                        DataService.asmx?wsdl
 Using Objects and Intrinsics
                                                             [Run Sample] |
 The WebService Behavior                                                                           [View Sample]
                                                             [View Source]
 HTML Pattern Matching


ASP.NET Web Applications                             The client application for this Web Service calls GetTitleAuthors and binds
                                                     the Authors table to a DataGrid control, as you've seen in previous
 Application Overview                                examples. To illustrate the PutTitleAuthors method, the client removes
 Using the Global.asax File                          three rows of data from the DataSet before calling this method, printing
 Managing Application State                          out the number of rows received by the service.
 HttpHandlers and Factories


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching                                           VB DataServiceClient.aspx

                                                             [Run Sample] | [View Source]
Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/servicesanddata.aspx (1 of 2) [4/02/2002 8:51:21 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/servicesanddata.aspx (2 of 2) [4/02/2002 8:51:21 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Use Objects and Intrinsics
 Introduction
 What is ASP.NET?                                    This sample illustrates how to access ASP.NET intrinsics such as the
                                                     Session and Application objects. It also shows how to turn off Session
 Language Support
                                                     on a per-[WebMethod] basis.

ASP.NET Web Forms                                    The first method in the sample .asmx file, UpdateHitCounter, accesses
 Introducing Web Forms                               the Session and adds 1 to the "HitCounter" value. It then returns this
 Working with Server Controls                        value as a String. The second method, UpdateAppCounter does the
                                                     same thing, but with the Application. Notice the following:
 Applying Styles to Controls
 Server Control Form Validation
 Web Forms User Controls                                   <WebMethod(EnableSession:=true)>
 Data Binding Server Controls
 Server-Side Data Access                             VB
 Data Access and Customization
 Working with Business Objects                       Session state for Web Services is disabled by default, and you have to use
                                                     a special attribute property to enable Sessions. However, Sessions aren't
 Authoring Custom Controls
                                                     needed for this object, since it only uses the Application object.
 Web Forms Controls Reference
 Web Forms Syntax Reference


ASP.NET Web Services
 Introducing Web Services
 Writing a Simple Web Service
 Web Service Type Marshalling
                                                             VB
 Using Data in Web Services                                                                        VB
                                                             SessionService.asmx
 Using Objects and Intrinsics                                                                      SessionService.asmx?wsdl
 The WebService Behavior                                     [Run Sample] |
 HTML Pattern Matching
                                                                                                  [View Sample]
                                                             [View Source]

ASP.NET Web Applications
                                                     When the client proxy is accessed, it contains a cookie collection. This
 Application Overview                                collection is used to accept and return the APSESSIONID cookie that
 Using the Global.asax File                          ASP.NET uses to track Sessions. This is what allows this client to receive
 Managing Application State                          varying answers to the Session hit method.
 HttpHandlers and Factories


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching                                           VB SessionServiceClient.aspx

                                                             [Run Sample] | [View Source]
Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/servicesandobjs.aspx (1 of 2) [4/02/2002 8:51:22 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/servicesandobjs.aspx (2 of 2) [4/02/2002 8:51:22 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           The WebService Behavior
 Introduction
 What is ASP.NET?                         Microsoft recently released a new SOAP-enabled DHTML behavior for Microsoft Internet Explorer 5.0
                                          and later versions. The new WebService behavior enables client-side script to invoke remote
 Language Support
                                          methods exposed by Microsoft .NET Web Services, or other Web servers that support the Simple
                                          Object Access Protocol (SOAP). The WebService behavior is implemented with an HTML
ASP.NET Web Forms                         Components (HTC) file as an attached behavior, so it can be used in Internet Explorer.
 Introducing Web Forms
 Working with Server Controls             The purpose of the WebService behavior is to provide a simple way of using and leveraging SOAP,
                                          without requiring expert knowledge of its implementation. The WebService behavior supports the
 Applying Styles to Controls              use of a wide variety of data types, including intrinsic SOAP data types, arrays, and Extensible
 Server Control Form Validation           Markup Language (XML) data. This flexible component enables Internet Explorer to retrieve
 Web Forms User Controls                  information from Web Services and to update a page dynamically using DHTML and script, without
                                          requiring navigation or a full page refresh.
 Data Binding Server Controls
 Server-Side Data Access
                                          The next generation of .NET development tools and infrastructure, including Visual Studio.NET, the
 Data Access and Customization            .NET Framework, and the .NET Enterprise Servers, are designed for the development of applications
 Working with Business Objects            based on the Web Services model. The WebService behavior is particularly significant because it
                                          enables Internet Explorer to use these next-generation Web Services.
 Authoring Custom Controls
 Web Forms Controls Reference
                                          The Microsoft Developer Network (MSDN) site provides the following documentation.
 Web Forms Syntax Reference

                                          WebService http://msdn.microsoft.com/workshop/author/webservice/overview.asp
ASP.NET Web Services                      Behavior
 Introducing Web Services                 Overview
 Writing a Simple Web Service             Using the  http://msdn.microsoft.com/workshop/author/webservice/using.asp
 Web Service Type Marshalling             WebService
                                          Behavior
 Using Data in Web Services
                                          The        http://msdn.microsoft.com/workshop/author/webservice/webservice.asp
 Using Objects and Intrinsics
                                          WebService
 The WebService Behavior                  Behavior
 HTML Pattern Matching


ASP.NET Web Applications
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model
 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication


 http://samples.gotdotnet.com/quickstart/aspplus/doc/wsbehavior.aspx (1 of 2) [4/02/2002 8:51:24 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




 http://samples.gotdotnet.com/quickstart/aspplus/doc/wsbehavior.aspx (2 of 2) [4/02/2002 8:51:24 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      HTML Text Pattern Matching
 Introduction
 What is ASP.NET?                                    This example demonstrates how to create a client proxy for any URI that
                                                     serves up text. Instead of authoring the .asmx file, you can create a WSDL
 Language Support
                                                     file that describes an HTML (or XML or any other nonbinary format) page
                                                     you currently offer. The WSDL can be used to generate a client proxy,
ASP.NET Web Forms                                    using the WSDL.exe command line tool that will use RegEx to parse the
                                                     named HTML page and extract values.
 Introducing Web Forms
 Working with Server Controls
                                                     You can do this by adding <Match> tags in the Response section of the
 Applying Styles to Controls                         WSDL. These tags take an attribute called pattern, which is the Regular
 Server Control Form Validation                      Expression that corresponds to the piece of text on the page that is the
 Web Forms User Controls                             property's value. (Note: the property from the proxy class is read-only.)

 Data Binding Server Controls
                                                     The consuming code can then create the object, access the Matches
 Server-Side Data Access
                                                     object that is returned by the functioned name in the WSDL, and gain
 Data Access and Customization                       access to any piece of the HTML as a property. No understanding of WSDL,
 Working with Business Objects                       regular expressions, or even HTML is needed to use the proxy class. It
                                                     behaves like any other .NET Framework class would.
 Authoring Custom Controls
 Web Forms Controls Reference
 Web Forms Syntax Reference


ASP.NET Web Services
 Introducing Web Services
 Writing a Simple Web Service
                                                              VB MatchClient.aspx
 Web Service Type Marshalling
 Using Data in Web Services
                                                             [Run Sample] | [View Source]
 Using Objects and Intrinsics
 The WebService Behavior
 HTML Pattern Matching


ASP.NET Web Applications
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/htmlscraping.aspx (1 of 2) [4/02/2002 8:51:25 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/htmlscraping.aspx (2 of 2) [4/02/2002 8:51:25 AM]
Microsoft ASP.NET QuickStarts Tutorial

Getting Started                             Application Overview
 Introduction
 What is ASP.NET?                                    What is an ASP.NET Application?
 Language Support                                    Creating an Application
                                                     Lifetime of an Application
ASP.NET Web Forms                                    A Note on Multiple Threads
 Introducing Web Forms                               Section Summary
 Working with Server Controls
 Applying Styles to Controls
 Server Control Form Validation             What is an ASP.NET Application?
 Web Forms User Controls
 Data Binding Server Controls               ASP.NET defines an application as the sum of all files, pages, handlers, modules, and
 Server-Side Data Access                    executable code that can be invoked or run in the scope of a given virtual directory (and
                                            its subdirectories) on a Web application server. For example, an "order" application might
 Data Access and Customization              be published in the "/order" virtual directory on a Web server computer. For IIS the virtual
 Working with Business Objects              directory can be set up in the Internet Services Manager; it contains all subdirectories,
 Authoring Custom Controls                  unless the subdirectories are virtual directories themselves.
 Web Forms Controls Reference
 Web Forms Syntax Reference                 Each ASP.NET application on a Web server is executed within a unique .NET Framework
                                            application domain, which guarantees class isolation (no versioning or naming conflicts),
                                            security sandboxing (preventing access to certain machine or network resources), and
ASP.NET Web Services                        static variable isolation.
 Introducing Web Services
 Writing a Simple Web Service               ASP.NET maintains a pool of HttpApplication instances over the course of a Web
                                            application's lifetime. ASP.NET automatically assigns one of these instances to process
 Web Service Type Marshalling
                                            each incoming HTTP request that is received by the application. The particular
 Using Data in Web Services                 HttpApplication instance assigned is responsible for managing the entire lifetime of the
 Using Objects and Intrinsics               request and is reused only after the request has been completed. This means that user
                                            code within the HttpApplication does not need to be reentrant.
 The WebService Behavior
 HTML Pattern Matching
                                            Creating an Application

ASP.NET Web Applications
                                            To create an ASP.NET application you can use an existing virtual directory or create a new
 Application Overview                       one. For example, if you installed Windows 2000 Server including IIS, you probably have a
 Using the Global.asax File                 directory C:\InetPub\WWWRoot. You can configure IIS using the Internet Services
 Managing Application State                 Manager, available under Start -> Programs -> Administrative Tools. Right-click on an
                                            existing directory and choose either New (to create a new virtual directory) or Properties
 HttpHandlers and Factories                 (to promote an existing regular directory).


Cache Services                              By placing a simple .aspx page like the following in the virtual directory and accessing it
 Caching Overview                           with the browser, you trigger the creation of the ASP.NET application.
 Page Output Caching
 Page Fragment Caching
                                                  <%@Page Language="VB"%>
 Page Data Caching                                <html>
                                                  <body>
                                                  <h1>hello world, <% Response.Write(DateTime.Now.ToString()) %></h1>
Configuration                                     </body>
 Configuration Overview                           </html>
 Configuration File Format
 Retrieving Configuration                   VB


Deployment                                  Now you can add appropriate code to use the Application object--to store objects with
 Deploying Applications                     application scope, for example. By creating a global.asax file you also can define various
                                            event handlers-- for the Application_Start event, for example.
 Using the Process Model
 Handling Errors
                                            Lifetime of an Application

Security
                                            An ASP.NET application is created the first time a request is made to the server; before


http://samples.gotdotnet.com/quickstart/aspplus/doc/applications.aspx (1 of 2) [4/02/2002 8:51:27 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Security Overview                          that, no ASP.NET code executes. When the first request is made, a pool of
                                            HttpApplication instances is created and the Application_Start event is raised. The
 Authentication & Authorization
                                            HttpApplication instances process this and subsequent requests, until the last instance
 Windows-based Authentication               exits and the Application_End event is raised.
 Forms-based Authentication
 Authorizing Users and Roles                Note that the Init and Dispose methods of HttpApplication are called per instance and
 User Account Impersonation                 thus can be called several times between Application_Start and Application_End.
                                            Only these events are shared among all instances of HttpApplication in one ASP.NET
 Security and WebServices
                                            application.

Localization                                A Note on Multiple Threads
 Internationalization Overview
 Setting Culture and Encoding               If you use objects with application scope, you should be aware that ASP.NET processes
 Localizing ASP.NET Applications            requests concurrently and that the Application object can be accessed by multiple
 Working with Resource Files                threads. Therefore the following code is dangerous and might not produce the expected
                                            result, if the page is repeatedly requested by different clients at the same time.

Tracing
 Tracing Overview                                 <%
                                                  Application("counter") = CType(Application("counter") + 1, Int32)
 Trace Logging to Page Output
                                                  %>
 Application-level Trace Logging

                                            VB
Debugging
 The SDK Debugger                           To make this code thread safe, serialize the access to the Application object using the
                                            Lock and UnLock methods. However, doing so also means accepting a considerable
                                            performance hit:
Performance
 Performance Overview
 Performance Tuning Tips                          <%
 Measuring Performance                            Application.Lock()
                                                  Application("counter") = CType(Application("counter") + 1, Int32)
                                                  Application.UnLock()
ASP to ASP.NET Migration                          %>
 Migration Overview
 Syntax and Semantics                       VB
 Language Compatibility
 COM Interoperability                       Another solution is to make the object stored with an application scope thread safe. For
 Transactions                               example, note that the collection classes in the System.Collections namespace are not
                                            thread safe for performance reasons.

Sample Applications                         Section Summary
 A Personalized Portal
 An E-Commerce Storefront
                                                  1. ASP.NET applications consist of everything under one virtual directory of the Web
 A Class Browser Application                         server.
 IBuySpy.com                                      2. You create an ASP.NET application by adding files to a virtual directory on the
                                                     Web server.
                                                  3. The lifetime of an ASP.NET application is marked by Application_Start and
 Get URL for this page                               Application_End events.
                                                  4. Access to application-scope objects must be safe for multithreaded access.




http://samples.gotdotnet.com/quickstart/aspplus/doc/applications.aspx (2 of 2) [4/02/2002 8:51:27 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                       Using the Global.asax File
 Introduction
 What is ASP.NET?                              The Global.asax File
 Language Support                              Application or Session-Scoped Events
                                               Application or Session-Scoped Objects
ASP.NET Web Forms                              Section Summary
 Introducing Web Forms
 Working with Server Controls
 Applying Styles to Controls          The Global.asax File
 Server Control Form Validation
 Web Forms User Controls              In addition to writing UI code, developers can also add application level logic and event handling code into their
 Data Binding Server Controls         Web applications. This code does not handle generating UI and is typically not invoked in response to individual
                                      page requests. Instead, it is responsible for handling higher-level application events such as Application_Start,
 Server-Side Data Access              Application_End, Session_Start, Session_End, and so on. Developers author this logic using a Global.asax
 Data Access and Customization        file located at the root of a particular Web application's virtual directory tree. ASP.NET automatically parses and
 Working with Business Objects        compiles this file into a dynamic .NET Framework class--which extends the HttpApplication base class--the first
                                      time any resource or URL within the application namespace is activated or requested.
 Authoring Custom Controls
 Web Forms Controls Reference
                                      The Global.asax file is parsed and dynamically compiled by ASP.NET into a .NET Framework class the first time any
 Web Forms Syntax Reference           resource or URL within its application namespace is activated or requested. The Global.asax file is configured to
                                      automatically reject any direct URL request so that external users cannot download or view the code within.
ASP.NET Web Services
 Introducing Web Services             Application or Session-Scoped Events
 Writing a Simple Web Service
 Web Service Type Marshalling         Developers can define handlers for events of the HttpApplication base class by authoring methods in the
                                      Global.asax file that conform to the naming pattern "Application_EventName(AppropriateEventArgumentSignature)".
 Using Data in Web Services
                                      For example:
 Using Objects and Intrinsics
 The WebService Behavior
 HTML Pattern Matching                     <script language="VB" runat="server">

                                           Sub Application_Start()
ASP.NET Web Applications                     ' Application startup code goes here
 Application Overview                      End Sub
                                           </script>
 Using the Global.asax File
 Managing Application State
                                      VB
 HttpHandlers and Factories

                                      If the event handling code needs to import additional namespaces, the @ import directive can be used on an .aspx
Cache Services                        page, as follows:
 Caching Overview
 Page Output Caching                       <%@ Import Namespace="System.Text" %>
 Page Fragment Caching
 Page Data Caching                    The following sample illustrates the lifetime of Application, Session, and Request.


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment                                    VB Application1.aspx
 Deploying Applications
 Using the Process Model
                                             [Run Sample] | [View Source]
 Handling Errors
                                      The first time the page is opened, the Start event is raised for the application and the session:

Security
 Security Overview
                                           Sub Application_Start()
 Authentication & Authorization              Response.Write("Application is Starting...<br>")
 Windows-based Authentication              End Sub
 Forms-based Authentication                Sub Session_Start()
 Authorizing Users and Roles                 Response.Write("Session is Starting...<br>")
 User Account Impersonation                  Session.Timeout = 1
                                           End Sub
 Security and WebServices

                                      VB
Localization
 Internationalization Overview


 http://samples.gotdotnet.com/quickstart/aspplus/doc/globalasax.aspx (1 of 2) [4/02/2002 8:51:29 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Setting Culture and Encoding         The BeginRequest and EndRequest events are raised on each request. When the page is refreshed, only
                                      messages from BeginRequest, EndRequest, and the Page_Load method will appear. Note that by abandoning
 Localizing ASP.NET Applications
                                      the current session (click the "End this session" button) a new session is created and the Session_Start event is
 Working with Resource Files          raised again.


Tracing                               Application or Session-Scoped Objects
 Tracing Overview
 Trace Logging to Page Output         Static objects, .NET Framework classes, and COM components all can be defined in the Global.asax file using the
 Application-level Trace Logging      object tag. The scope can be appinstance, session, or application. The appinstance scope denotes that the
                                      object is specific to one instance of HttpApplication and is not shared.

Debugging                                  <object id="id" runat="server" class=".NET Framework class Name" scope="appinstance"/>
 The SDK Debugger                          <object id="id" runat="server" progid="COM ProgID" scope="session"/>
                                           <object id="id" runat="server" classid="COM ClassID" scope="application"/>

Performance
 Performance Overview                 Section Summary
 Performance Tuning Tips
 Measuring Performance                     1. ASP.NET applications can define event handlers with application-wide or session-wide scope in the
                                              Global.asax file.
                                           2. ASP.NET applications can define objects with application-wide or session-wide scope in the Global.asax file.
ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


Get URL for this page




 http://samples.gotdotnet.com/quickstart/aspplus/doc/globalasax.aspx (2 of 2) [4/02/2002 8:51:29 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                     Managing Application State
 Introduction
 What is ASP.NET?                            Using Application State
 Language Support                            Using Session State
                                             Using Client-Side Cookies
ASP.NET Web Forms                            Using ViewState
 Introducing Web Forms                       Section Summary
 Working with Server Controls
 Applying Styles to Controls
 Server Control Form Validation     Using Application State
 Web Forms User Controls
 Data Binding Server Controls       This sample illustrates the use of application state to read a dataset in Application_Start.
 Server-Side Data Access
 Data Access and Customization
 Working with Business Objects
 Authoring Custom Controls
 Web Forms Controls Reference
 Web Forms Syntax Reference
                                            VB Application2.aspx
ASP.NET Web Services
 Introducing Web Services                  [Run Sample] | [View Source]
 Writing a Simple Web Service
 Web Service Type Marshalling       Because an application and all the objects it stores can be concurrently accessed by different threads, it is better to store
 Using Data in Web Services         only infrequently modified data with application scope. Ideally an object is initialized in the Application_Start event and
                                    further access is read-only.
 Using Objects and Intrinsics
 The WebService Behavior
                                    In the following sample a file is read in Application_Start (defined in the Global.asax file) and the content is stored in a
 HTML Pattern Matching
                                    DataView object in the application state.

ASP.NET Web Applications
 Application Overview                     Sub Application_Start()
                                              Dim ds As New DataSet()
 Using the Global.asax File
 Managing Application State                    Dim fs As New FileStream(Server.MapPath("schemadata.xml"),FileMode.Open,FileAccess.Read)
                                               Dim reader As New StreamReader(fs)
 HttpHandlers and Factories
                                               ds.ReadXml(reader)
                                               fs.Close()
Cache Services                                Dim view As New DataView (ds.Tables(0))
 Caching Overview                             Application("Source") = view
 Page Output Caching                      End Sub
 Page Fragment Caching
 Page Data Caching                  VB


                                    In the Page_Load method, the DataView is then retrieved and used to populate a DataGrid object:
Configuration
 Configuration Overview
 Configuration File Format                Sub Page_Load(sender As Object, e As EventArgs)
 Retrieving Configuration                     Dim Source As New DataView = CType(Application("Source"), DataView)
                                              ...
                                              MyDataGrid.DataSource = Source
Deployment                                    ...
 Deploying Applications                   End Sub
 Using the Process Model
 Handling Errors                    VB


                                    The advantage of this solution is that only the first request pays the price of retrieving the data. All subsequent requests use
Security
                                    the already existing DataView object. As the data is never modified after initialization, you do not have to make any
 Security Overview                  provisions for serializing access.
 Authentication & Authorization
 Windows-based Authentication       Using Session State
 Forms-based Authentication
 Authorizing Users and Roles        The following sample illustrates the use of session state to store volatile user preferences.
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


 http://samples.gotdotnet.com/quickstart/aspplus/doc/stateoverview.aspx (1 of 5) [4/02/2002 8:51:32 AM]
 Microsoft ASP.NET QuickStarts Tutorial


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging
                                           VB Session1.aspx
Debugging
 The SDK Debugger                          [Run Sample] | [View Source]


Performance                         To provide individual data for a user during a session, data can be stored with session scope. In the following sample,
                                    values for user preferences are initialized in the Session_Start event in the Global.asax file.
 Performance Overview
 Performance Tuning Tips
 Measuring Performance                    Sub Session_Start()
                                              Session("BackColor") = "beige"
                                              ...
ASP to ASP.NET Migration                  End Sub
 Migration Overview
 Syntax and Semantics
                                    VB
 Language Compatibility
 COM Interoperability               In the following customization page, values for user preferences are modified in the Submit_Click event handler according
 Transactions                       to user input.


Sample Applications                       Protected Sub Submit_Click(sender As Object, e As EventArgs)
 A Personalized Portal                        Session("BackColor") = BackColor.Value
 An E-Commerce Storefront                     ...
 A Class Browser Application                  Response.Redirect(State("Referer").ToString())
 IBuySpy.com                              End Sub


Get URL for this page               VB


                                    The individual values are retrieved using the GetStyle method:



                                          Protected GetStyle(key As String) As String
                                              Return(Session(key).ToString())
                                          End Sub


                                    VB


                                    The GetStyle method is used to construct session-specific styles:


                                          <style>
                                              body
                                              {
                                                font: <%=GetStyle("FontSize")%> <%=GetStyle("FontName")%>;
                                                background-color: <%=GetStyle("BackColor")%>;
                                              }
                                              a
                                              {
                                                   color: <%=GetStyle("LinkColor")%>
                                              }
                                          </style>


                                    To verify that the values are really stored with session scope, open the sample page twice, then change one value in the
                                    first browser window and refresh the second one. The second window picks up the changes because both browser instances
                                    share a common Session object.


                                    Configuring session state: Session state features can be configured via the <sessionState> section in a web.config
                                    file. To double the default timeout of 20 minutes, you can add the following to the web.config file of an application:

                                          <sessionState timeout="40" />


                                    By default, ASP.NET will store the session state in the same process that processes the request, just as ASP does. If cookies
                                    are not available, a session can be tracked by adding a session identifier to the URL. This can be enabled by setting the
                                    following:



                                          <sessionState
                                             cookieless="true"
                                          />




 http://samples.gotdotnet.com/quickstart/aspplus/doc/stateoverview.aspx (2 of 5) [4/02/2002 8:51:32 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                   By default, ASP.NET will store the session state in the same process that processes the request, just as ASP does.
                                   Additionally, ASP.NET can store session data in an external process, which can even reside on another machine. To enable
                                   this feature:


                                         q   Start the ASP.NET state service, either using the Services snap-in or by executing "net start aspnet_state" on the
                                             command line. The state service will by default listen on port 42424. To change the port, modify the registry key
                                             for the service: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSte\Services\aspnet_state\Parameters\Port
                                         q   Set the mode attribute of the <sessionState> section to "StateServer".
                                         q   Configure the stateConnectionString attribute with the values of the machine on which you started
                                             aspnet_state.


                                   The following sample assumes that the state service is running on the same machine as the Web server ("localhost") and
                                   uses the default port (42424):


                                         <sessionState
                                            mode="StateServer"
                                            stateConnectionString="tcpip=localhost:42424"
                                         />


                                   Note that if you try the sample above with this setting, you can reset the Web server (enter iisreset on the command
                                   line) and the session state value will persist.


                                   Using Client-Side Cookies

                                   The following sample illustrates the use of client-side cookies to store volatile user preferences.




                                             VB Cookies1.aspx

                                          [Run Sample] | [View Source]


                                   Storing cookies on the client is one of the methods that ASP.NET's session state uses to associate requests with sessions.
                                   Cookies can also be used directly to persist data between requests, but the data is then stored on the client and sent to the
                                   server with every request. Browsers place limits on the size of a cookie; therefore, only a maximum of 4096 bytes is
                                   guaranteed to be acceptable.


                                   When the data is stored on the client, the Page_Load method in the file cookies1.aspx checks whether the client has sent
                                   a cookie. If not, a new cookie is created and initialized and stored on the client:



                                         Protected Sub Page_Load(sender As Object, e As EventArgs)
                                             If Request.Cookies("preferences1") = Null Then
                                                 Dim cookie As New HttpCookie("preferences1")
                                                 cookie.Values.Add("ForeColor", "black")
                                                 ...
                                                 Response.AppendCookie(cookie)
                                             End If
                                         End Sub


                                   VB


                                   On the same page, a GetStyle method is used again to provide the individual values stored in the cookie:



                                         Protected Function GetStyle(key As String) As String
                                           Dim cookie As HttpCookie = Request.Cookies("preferences1")
                                           If cookie <> Null Then
                                             Select Case key
                                               Case "ForeColor"
                                                  Return(cookie.Values("ForeColor"))
                                               Case ...
                                             End Select
                                           End If
                                           Return("")
                                         End Function


                                   VB


                                   Verify that the sample works by opening the cookies1.aspx page and modifying the preferences. Open the page in another
                                   window, it should pick up the new preferences. Close all browser windows and open the cookies1.aspx page again. This
                                   should delete the temporary cookie and restore the default preference values.


http://samples.gotdotnet.com/quickstart/aspplus/doc/stateoverview.aspx (3 of 5) [4/02/2002 8:51:32 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                           VB Cookies2.aspx

                                          [Run Sample] | [View Source]


                                   To make a cookie persistent between sessions, the Expires property on the HttpCookie class has to be set to a date in the
                                   future. The following code on the customization.aspx page is identical to the previous sample, with the exception of the
                                   assignment to Cookie.Expires:



                                         Protected Sub Submit_Click(sender As Object, e As EventArgs)
                                             Dim cookie As New HttpCookie("preferences2")
                                             cookie.Values.Add("ForeColor",ForeColor.Value)
                                             ...
                                             cookie.Expires = DateTime.MaxValue ' Never Expires

                                              Response.AppendCookie(cookie)

                                             Response.Redirect(State("Referer").ToString())
                                         End Sub


                                   VB


                                   Verify that the sample is working by modifying a value, closing all browser windows, and opening cookies2.aspx again. The
                                   window should still show the customized value.


                                   Using ViewState

                                   This sample illustrates the use of the ViewState property to store request-specific values.




                                           VB PageState1.aspx

                                          [Run Sample] | [View Source]


                                   ASP.NET provides the server-side notion of a view state for each control. A control can save its internal state between
                                   requests using the ViewState property on an instance of the class StateBag. The StateBag class provides a dictionary-
                                   like interface to store objects associated with a string key.


                                   The file pagestate1.aspx displays one visible panel and stores the index of it in the view state of the page with the key
                                   PanelIndex:



                                         Protected Sub Next_Click(sender As Object, e As EventArgs)
                                             Dim PrevPanelId As String = "Panel" + ViewState("PanelIndex").ToString()
                                             ViewState("PanelIndex") = CType(ViewState("PanelIndex") + 1, Integer)
                                             Dim PanelId As String = "Panel" + ViewState("PanelIndex").ToString()
                                             ...
                                         End Sub


                                   VB


                                   Note that if you open the page in several browser windows, each browser window will initially show the name panel. Each
                                   window can independently navigate between the panels.


                                   Section Summary

                                         1. Use application state variables to store data that is modified infrequently but used often.
                                         2. Use session state variables to store data that is specific to one session or user. The data is stored entirely on the
                                            server. Use it for short-lived, bulky, or sensitive data.
                                         3. Store small amounts of volatile data in a nonpersistent cookie. The data is stored on the client, sent to the server
                                            on each request, and expires when the client ends execution.
                                         4. Store small amounts of non-volatile data in a persistent cookie. The data is stored on the client until it expires and



http://samples.gotdotnet.com/quickstart/aspplus/doc/stateoverview.aspx (4 of 5) [4/02/2002 8:51:32 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                            is sent to the server on each request.
                                         5. Store small amounts of request-specific data in the view state. The data is sent from the server to the client and
                                            back.




http://samples.gotdotnet.com/quickstart/aspplus/doc/stateoverview.aspx (5 of 5) [4/02/2002 8:51:32 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           HTTP Handlers and Factories
 Introduction
 What is ASP.NET?                                 Overview
 Language Support                                 Configuring HTTP Handlers and Factories
                                                  Creating a Custom HTTP Handler
ASP.NET Web Forms                                 Section Summary
 Introducing Web Forms
 Working with Server Controls
 Applying Styles to Controls              Overview
 Server Control Form Validation
 Web Forms User Controls                  ASP.NET provides a low-level request/response API that enables developers to use .NET Framework classes to
 Data Binding Server Controls             service incoming HTTP requests. Developers accomplish this by authoring classes that support the
                                          System.Web.IHTTPHandler interface and implement the ProcessRequest() method. Handlers are often
 Server-Side Data Access                  useful when the services provided by the high-level page framework abstraction are not required for processing
 Data Access and Customization            the HTTP request. Common uses of handlers include filters and CGI-like applications, especially those that
 Working with Business Objects            return binary data.
 Authoring Custom Controls
 Web Forms Controls Reference             Each incoming HTTP request received by ASP.NET is ultimately processed by a specific instance of a class that
                                          implements IHTTPHandler. IHttpHandlerFactory provides the infrastructure that handles the actual
 Web Forms Syntax Reference               resolution of URL requests to IHttpHandler instances. In addition to the default IHttpHandlerFactory
                                          classes provided by ASP.NET, developers can optionally create and register factories to support rich request
                                          resolution and activation scenarios.
ASP.NET Web Services
 Introducing Web Services                 Configuring HTTP Handlers and Factories
 Writing a Simple Web Service
 Web Service Type Marshalling             HTTP handlers and factories are declared in the ASP.NET configuration as part of a web.config file. ASP.NET
 Using Data in Web Services               defines an <httphandlers> configuration section where handlers and factories can be added and removed.
                                          Settings for HttpHandlerFactory and HttpHandler are inherited by subdirectories.
 Using Objects and Intrinsics
 The WebService Behavior
                                          For example, ASP.NET maps all requests for .aspx files to the PageHandlerFactory class in the global
 HTML Pattern Matching                    machine.config file:


ASP.NET Web Applications                       <httphandlers>
 Application Overview                            ...
                                                 <add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory,System.Web" />
 Using the Global.asax File
                                                 ...
 Managing Application State                    </httphandlers>
 HttpHandlers and Factories
                                          Creating a Custom HTTP Handler
Cache Services
 Caching Overview                         The following sample creates a custom HttpHandler that handles all requests to "SimpleHandler.aspx".
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format                       VB SimpleHandler
 Retrieving Configuration
                                                 [Run Sample] | [View Source]
Deployment
 Deploying Applications                   A custom HTTP handler can be created by implementing the IHttpHandler interface, which contains only two
 Using the Process Model                  methods. By calling IsReusable, an HTTP factory can query a handler to determine whether the same instance
                                          can be used to service multiple requests. The ProcessRequest method takes an HttpContext instance as a
 Handling Errors
                                          parameter, which gives it access to the Request and Response intrinsics. In the following sample, request
                                          data is ignored and a constant string is sent as a response to the client.
Security
 Security Overview
                                               Public Class SimpleHandler : Inherits IHttpHandler
 Authentication & Authorization                  Public Sub ProcessRequest(context As HttpContext)
 Windows-based Authentication                      context.Response.Write("Hello World!")
 Forms-based Authentication                      End Sub

 Authorizing Users and Roles                     Public Function IsReusable() As Boolean
 User Account Impersonation                        Return(True)
                                                 End Function
 Security and WebServices
                                               End Class




 http://samples.gotdotnet.com/quickstart/aspplus/doc/httphandlers.aspx (1 of 2) [4/02/2002 8:51:34 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Localization                              VB
 Internationalization Overview
 Setting Culture and Encoding             After placing the compiled handler assembly in the application's \bin directory, the handler class can be specified
                                          as a target for requests. In this case, all requests for "SimpleHandler.aspx" will be routed to an instance of the
 Localizing ASP.NET Applications
                                          SimpleHandler class, which lives in the namespace Acme.SimpleHandler.
 Working with Resource Files
                                               <httphandlers> <add verb="*" path="SimpleHandler.aspx"
Tracing                                        type="Acme.SimpleHandler,SimpleHandler" /> </httphandlers>
 Tracing Overview
 Trace Logging to Page Output             Section Summary
 Application-level Trace Logging
                                               1. HTTP Handlers and factories are the backbone of the ASP.NET page framework.
                                               2. Factories assign each request to one handler, which processes the request.
Debugging                                      3. Factories and handlers are defined in the web.config file. Settings for factories are inherited by
 The SDK Debugger                                 subdirectories.
                                               4. To create a custom handler, implement IHttpHandler and add the class in the <httphandlers>
                                                  section of the web.config in the directory.
Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




 http://samples.gotdotnet.com/quickstart/aspplus/doc/httphandlers.aspx (2 of 2) [4/02/2002 8:51:34 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Caching Overview
 Introduction
 What is ASP.NET?                                    Caching is a technique widely used in computing to increase performance
                                                     by keeping frequently accessed or expensive data in memory. In the
 Language Support
                                                     context of a Web application, caching is used to retain pages or data across
                                                     HTTP requests and reuse them without the expense of recreating them.
ASP.NET Web Forms
 Introducing Web Forms                               ASP.NET has three kinds of caching that can be used by Web applications:
 Working with Server Controls
 Applying Styles to Controls                                q   Output caching, which caches the dynamic response generated by
 Server Control Form Validation                                 a request.
                                                            q   Fragment caching, which caches portions of a response generated
 Web Forms User Controls
                                                                by a request.
 Data Binding Server Controls                               q   Data caching, which caches arbitrary objects programmatically. To
 Server-Side Data Access                                        support this, ASP.NET provides a full-featured cache engine that
 Data Access and Customization                                  allows programmers to easily retain data across requests.
 Working with Business Objects
 Authoring Custom Controls                           Output caching is useful when the contents of an entire page can be
                                                     cached. On a heavily accessed site, caching frequently accessed pages for
 Web Forms Controls Reference                        even a minute at a time can result in substantial throughput gains. While a
 Web Forms Syntax Reference                          page is cached by the output cache, subsequent requests for that page are
                                                     served from the output page without executing the code that created it.

ASP.NET Web Services
                                                     Sometimes it is not practical to cache an entire page - perhaps portions of
 Introducing Web Services                            the page must be created or customized for each request. In this case, it is
 Writing a Simple Web Service                        often worthwhile to identify objects or data that are expensive to construct
 Web Service Type Marshalling                        and are eligible for caching. Once these items are identified, they can be
                                                     created once and then cached for some period of time. Additionally,
 Using Data in Web Services                          fragment caching can be used to cache regions of a page's output.
 Using Objects and Intrinsics
 The WebService Behavior                             Choosing the time to cache an item can be an interesting decision. For
 HTML Pattern Matching                               some items, the data might be refreshed at regular intervals or the data is
                                                     valid for a certain amount of time. In that case, the cache items can be
                                                     given an expiration policy that causes them to be removed from the cache
ASP.NET Web Applications                             when they have expired. Code that accesses the cache item simply checks
 Application Overview                                for the absence of the item and recreates it, if necessary.
 Using the Global.asax File
 Managing Application State                          The ASP.NET cache supports file and cache key dependencies, allowing
                                                     developers to make a cache item dependent on an external file or another
 HttpHandlers and Factories                          cache item. This technique can be used to invalidate items when their
                                                     underlying data source changes.
Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/cachingoverview.aspx (1 of 2) [4/02/2002 8:51:35 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/cachingoverview.aspx (2 of 2) [4/02/2002 8:51:35 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Page Output Caching
 Introduction
 What is ASP.NET?                                    Output caching is a powerful technique that increases request/response
                                                     throughput by caching the content generated from dynamic pages. Output
 Language Support
                                                     caching is enabled by default, but output from any given response is not
                                                     cached unless explicit action is taken to make the response cacheable.
ASP.NET Web Forms
 Introducing Web Forms                               To make a response eligible for output caching, it must have a valid
 Working with Server Controls                        expiration/validation policy and public cache visibility. This can be done
                                                     using either the low-level OutputCache API or the high-level @
 Applying Styles to Controls                         OutputCache directive. When output caching is enabled, an output cache
 Server Control Form Validation                      entry is created on the first GET request to the page. Subsequent GET or
 Web Forms User Controls                             HEAD requests are served from the output cache entry until the cached
                                                     request expires.
 Data Binding Server Controls
 Server-Side Data Access
                                                     The output cache also supports variations of cached GET or POST
 Data Access and Customization                       name/value pairs.
 Working with Business Objects
 Authoring Custom Controls                           The output cache respects the expiration and validation policies for pages.
 Web Forms Controls Reference                        If a page is in the output cache and has been marked with an expiration
                                                     policy that indicates that the page expires 60 minutes from the time it is
 Web Forms Syntax Reference
                                                     cached, the page is removed from the output cache after 60 minutes. If
                                                     another request is received after that time, the page code is executed and
                                                     the page can be cached again. This type of expiration policy is called
ASP.NET Web Services
                                                     absolute expiration - a page is valid until a certain time.
 Introducing Web Services
 Writing a Simple Web Service
                                                     The following example demonstrates a simple way to output cache
 Web Service Type Marshalling                        responses using the @ OutputCache directive. The example simply
 Using Data in Web Services                          displays the time when the response was generated. To see output caching
                                                     in action, invoke the page and note the time at which the response was
 Using Objects and Intrinsics
                                                     generated. Then refresh the page and note that the time has not changed,
 The WebService Behavior                             indicating that the second response is being served from the output cache.
 HTML Pattern Matching


ASP.NET Web Applications
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories                                   VB Outputcache1.aspx


Cache Services                                               [Run Sample] | [View Source]
 Caching Overview
 Page Output Caching                                 The following directive activates output caching on the response:
 Page Fragment Caching
 Page Data Caching                                         <%@ OutputCache Duration="60" VaryByParam="none"%>


Configuration                                        This directive simply indicates that the page should be cached for 60
 Configuration Overview                              seconds and that the page does not vary by any GET or POST parameters.
                                                     Requests received while the page is still cached are satisfied from the
 Configuration File Format                           cache. After 60 seconds, the page is removed from the cache; the next
 Retrieving Configuration                            request is handled explicitly and caches the page again.


Deployment                                           Of course, in the previous example, very little work is saved by output
                                                     caching. The following example shows the same technique for output
 Deploying Applications                              caching, but queries a database and displays the results in a grid.
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/outputcaching.aspx (1 of 3) [4/02/2002 8:51:38 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication                                 VB Outputcache2.aspx
 Forms-based Authentication
 Authorizing Users and Roles                                 [Run Sample] | [View Source]
 User Account Impersonation
 Security and WebServices
                                                     In the final example, the application is modified slightly to allow the user to
                                                     selectively query for authors in various states. This example demonstrates
                                                     caching requests varying by the name/value pairs in the query string using
Localization
                                                     the VaryByParam attribute of the @ OutputCache directive.
 Internationalization Overview
 Setting Culture and Encoding
                                                           <%@ OutputCache Duration="60" VaryByParm="state" %>
 Localizing ASP.NET Applications
 Working with Resource Files
                                                     For each state in the data set, there is a link that passes the desired state
                                                     as part of the query string. The application then constructs the appropriate
Tracing                                              database query and shows authors belonging only to the selected state.
 Tracing Overview
 Trace Logging to Page Output                        Note that the first time you click the link for a given state, it generates a
                                                     new timestamp at the bottom of the page. Thereafter, whenever a request
 Application-level Trace Logging                     for that state is resubmitted within a minute, you get the original
                                                     timestamp indicating that the request has been cached.
Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance                                        VB Outputcache3.aspx

                                                             [Run Sample] | [View Source]
ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics                                Applications that want more control over the HTTP headers related to
                                                     caching can use the functionality provided by the
 Language Compatibility
                                                     System.Web.HttpCachePolicy class. The following example shows the
 COM Interoperability                                code equivalent to the page directives used in the previous samples.
 Transactions

                                                           Response.Cache.SetExpires(DateTime.Now.AddSeconds(60))
Sample Applications                                        Response.Cache.SetCacheability(HttpCacheability.Public)
 A Personalized Portal
 An E-Commerce Storefront                            VB
 A Class Browser Application
 IBuySpy.com                                         To make this a sliding expiration policy, where the expiration time out
                                                     resets each time the page is requested, set the SlidingExpiration
                                                     property as shown in the following code.
 Get URL for this page


                                                           Response.Cache.SetExpires(DateTime.Now.AddSeconds(60))
                                                           Response.Cache.SetCacheability(HttpCacheability.Public)
                                                           Response.Cache.SetSlidingExpiration(True)


http://samples.gotdotnet.com/quickstart/aspplus/doc/outputcaching.aspx (2 of 3) [4/02/2002 8:51:38 AM]
Microsoft ASP.NET QuickStarts Tutorial



                                                     VB


                                                     Note: When sliding expiration is enabled (SetSlidingExpiration(true)),
                                                     a request made to the origin server always generates a response. Sliding
                                                     expiration is useful in scenarios where there are downstream caches that
                                                     can satisfy client requests, if the content has not expired yet, without
                                                     requesting the content from the origin server.


                                                     Applications being ported from ASP may already be setting cache policy
                                                     using the ASP properties; for example:



                                                           Response.CacheControl = "Public"
                                                           Response.Expires = 60


                                                     VB


                                                     These properties are supported by ASP.NET and have the same effect as
                                                     the other examples that have been shown.


                                                     Section Summary

                                                           1. Output caching caches the content generated by ASP.NET pages.
                                                           2. Pages are not placed in the output cache unless they have a valid
                                                              expiration or validation policy and public cache visibility.




http://samples.gotdotnet.com/quickstart/aspplus/doc/outputcaching.aspx (3 of 3) [4/02/2002 8:51:38 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                      Page Fragment Caching
 Introduction
 What is ASP.NET?                    In addition to output caching an entire page, ASP.NET provides a simple way for you to output cache regions of page
                                     content, which is appropriately named fragment caching. You delineate regions of your page with a user control, and
 Language Support
                                     mark them for caching using the @ OutputCache directive introduced in the previous section. This directive specifies
                                     the duration (in seconds) that the output content of the user control should be cached on the server, as well as any
ASP.NET Web Forms                    optional conditions by which it should be varied.
 Introducing Web Forms
 Working with Server Controls        For example, the following directive instructs ASP.NET to output cache the user control for 120 seconds, and to vary the
                                     caching using the "CategoryID" and "SelectedID" querystring or form post parameters.
 Applying Styles to Controls
 Server Control Form Validation
                                          <%@ OutputCache Duration="120" VaryByParam="CategoryID;SelectedID"%>
 Web Forms User Controls
 Data Binding Server Controls
                                     The VaryByParam attribute is extremely powerful and allows user control authors to instruct ASP.NET to cache/store
 Server-Side Data Access             multiple instances of an output cache region on the server. For example, the following URLs to the host page of the
 Data Access and Customization       previous user control cache separate instances of the user control content.
 Working with Business Objects
 Authoring Custom Controls                http://localhost/mypage.aspx?categoryid=foo&selectedid=0
                                          http://localhost/mypage.aspx?categoryid=foo&selectedid=1
 Web Forms Controls Reference
 Web Forms Syntax Reference
                                     Logic within a user control can then dynamically generate different content (which is cached separately) depending on
                                     the arguments provided.
ASP.NET Web Services
 Introducing Web Services            In addition to supporting the VaryByParam attribute, fragment caching also supports a VaryByControl attribute.
 Writing a Simple Web Service        Whereas the VaryByParam attribute varies cached results based on name/value pairs sent using POST or GET, the
                                     VaryByControl attribute varies the cached fragment by controls within the user control. For example:
 Web Service Type Marshalling
 Using Data in Web Services
                                          <%@ OutputCache Duration="120" VaryByParam="none" VaryByControl="Category" %>
 Using Objects and Intrinsics
 The WebService Behavior
                                     Note that similar to output-cached pages, explict use of VaryByParam is required even if it is not used.
 HTML Pattern Matching

                                     If the user control contained a drop-down select box control named Category, the user control's output would vary
ASP.NET Web Applications             based on the selected value within that control.
 Application Overview
 Using the Global.asax File          Just as it is possible to nest user controls recursively within a page (that is, a user control declared within another server
 Managing Application State          control), it is also possible to nest output-cached user controls recursively. This provides a powerful composition model
                                     that enables cached regions to be composed of further subcached regions.
 HttpHandlers and Factories

                                     The following sample code demonstrates how to cache two menu sections of a page using a declarative user control.
Cache Services
 Caching Overview
 Page Output Caching                      <%@ Register TagPrefix="Acme" TagName="Menu" Src="Menu.ascx" %>
 Page Fragment Caching                    <html>
 Page Data Caching                          <body>
                                              <table>
                                                 <tr>
Configuration                                      <td>
 Configuration Overview                               <Acme:Menu Category="LeftMenu" runat=server/>
                                                   </td>
 Configuration File Format
                                                   <td>
 Retrieving Configuration                             <h1>Hi, the time is now: <%=Now%> </h1>
                                                   </td>
                                                   <td>
Deployment                                            <Acme:Menu Category="RightMenu" runat=server/>
 Deploying Applications                            </td>
 Using the Process Model                         <tr>
                                              </table>
 Handling Errors
                                            </body>
                                          </html>
Security
 Security Overview                   VB
 Authentication & Authorization
 Windows-based Authentication        The following sample code shows the implementation of the "Acme:Menu" user control with caching support.
 Forms-based Authentication
 Authorizing Users and Roles
                                          <%@ OutputCache Duration="120" VaryByParam="none" %>
 User Account Impersonation
 Security and WebServices                 <script language="VB" runat=server>

                                                Public Category As String;
Localization                                    Sub Page_Load(sender As Object, e As EventArgs)
 Internationalization Overview
 Setting Culture and Encoding                         Dim conn As AdoConnection = New AdoConnection("MyDSN")



 http://samples.gotdotnet.com/quickstart/aspplus/doc/fragmentcaching.aspx (1 of 2) [4/02/2002 8:51:40 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Localizing ASP.NET Applications                    MyMenu.DataSource = conn.Execute("select * from menu where category=" & Category)
                                                    MyMenu.DataBind()
 Working with Resource Files
                                                End Sub

                                           </script>
Tracing
 Tracing Overview                          <asp:datagrid id="MyMenu" runat=server/>
 Trace Logging to Page Output
 Application-level Trace Logging     VB


Debugging                            Note that this example output caches the response of each user control for a period of 120 seconds. All logic necessary
                                     to recreate each menu user control in the event of a cache miss (either because 120 seconds has expired or because
 The SDK Debugger
                                     memory conditions on the server have become scarce) is encapsulated cleanly within the user control.

Performance                          The following example shows simple fragment caching. The sample caches the output from a control that retrieves data
 Performance Overview                from an SQL Server database, while keeping the dynamic properties of the parent page. You can see that the page is
                                     dynamic because the time is updated with every refresh, while the control is only updated every 60 seconds.
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
                                             VB FragmentCache1.aspx
 COM Interoperability
 Transactions
                                            [Run Sample] | [View Source]

Sample Applications
 A Personalized Portal               Caveats
 An E-Commerce Storefront
 A Class Browser Application         Note: Attempts to programmatically manipulate an output-cached control from its containing page result in an error.
                                     For example, attempts to use a declarative data binding expression on the user control tag generates parser errors, as
 IBuySpy.com                         shown in the following code.

Get URL for this page                      <!-- The following tags generate parser errors. -->
                                           <Acme:Menu Category='<%# Container.DataItem("Category")'                            runat="server"/>


                                     The reason for this is simple. In cases when the content of a user control is output cached, an instance of the control is
                                     created only on the first request; thus, once cached, the control is no longer available. Instead, you should encapsulate
                                     all the logic necessary to create the content of a user control directly within the control itself; this is typically done within
                                     the user control's Page_Load event or Page_PreRender event.


                                     You can declare and use other declarative property parameters to customize the control. For example, the previous user
                                     control can be customized as follows:


                                           <Acme:Menu Category="LeftMenu" runat=server/>
                                           <Acme:Menu Category="RightMenu" runat=server/>


                                     These declarations cause the appropriate code to be generated and executed by the page compiler in the event that the
                                     control is created as a result of a cache miss. User control developers can then access these settings just as they would
                                     in a non-cached user control scenario.


                                     Section Summary

                                           1. In addition to output caching an entire page, ASP.NET provides a simple way for you to output cache regions
                                              of page content, which is appropriately named fragment caching.
                                           2. You delineate regions of your page with a user control and mark them for caching using the @ OutputCache
                                              directive introduced in the previous section.
                                           3. Just as it is possible to nest user controls recursively within a page (that is, a user control declared within
                                              another server control), it is also possible to nest output-cached user controls recursively.
                                           4. Attempts to programmatically manipulate an output-cached control from its containing page result in an error.
                                              Instead, you should encapsulate all the logic necessary to create the content of a user control directly within
                                              the control itself, typically within the user control's Page_Load event or Page_PreRender event.
                                           5. It is possible to declare and use other declarative property parameters to customize the control.




 http://samples.gotdotnet.com/quickstart/aspplus/doc/fragmentcaching.aspx (2 of 2) [4/02/2002 8:51:40 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                Page Data Caching
 Introduction
 What is ASP.NET?                                         Introduction to Data Caching
 Language Support                                         Using the Data Cache
                                                          Section Summary
ASP.NET Web Forms
 Introducing Web Forms
 Working with Server Controls                  Introduction to Data Caching
 Applying Styles to Controls
 Server Control Form Validation                ASP.NET provides a full-featured cache engine that can be used by pages to
 Web Forms User Controls                       store and retrieve arbitrary objects across HTTP requests. The ASP.NET cache is
                                               private to each application and stores objects in memory. The lifetime of the
 Data Binding Server Controls                  cache is equivalent to the lifetime of the application; that is, when the application
 Server-Side Data Access                       is restarted, the cache is recreated.
 Data Access and Customization
 Working with Business Objects                 The cache provides a simple dictionary interface that allows programmers to
 Authoring Custom Controls                     easily place objects in and retrieve them from the cache. In the simplest case,
                                               placing an item in the cache is just like adding an item to a dictionary:
 Web Forms Controls Reference
 Web Forms Syntax Reference
                                                     Cache("mykey") = myValue
ASP.NET Web Services
 Introducing Web Services                      VB
 Writing a Simple Web Service
 Web Service Type Marshalling                  Retrieving the data is just as simple:
 Using Data in Web Services
 Using Objects and Intrinsics
                                                     myValue = Cache("mykey")
 The WebService Behavior                             If myValue <> Null Then
 HTML Pattern Matching                                   DisplayData(myValue)
                                                     End If

ASP.NET Web Applications                       VB
 Application Overview
 Using the Global.asax File
                                               For applications that need more sophisticated functionality, the ASP.NET cache
 Managing Application State                    supports scavenging, expiration, and file and key dependencies.
 HttpHandlers and Factories
                                                      q   Scavenging means that the cache attempts to remove infrequently used
                                                          or unimportant items if memory becomes scarce. Programmers who
Cache Services
                                                          want to control how scavenging occurs can provide hints to the
 Caching Overview                                         scavenger when items are inserted into the cache that indicate the
 Page Output Caching                                      relative cost of creating the item and the relative rate at which the item
 Page Fragment Caching                                    must be accessed to remain useful.

 Page Data Caching
                                                      q   Expiration allows programmers to give cache items lifetimes, which can
                                                          be explicit (for example, expire at 6:00) or can be relative to an item's
Configuration                                             last use (for example, expire 20 minutes after the item was last
 Configuration Overview                                   accessed). After an item has expired, it is removed from the cache and
                                                          future attempts to retrieve it return the null value unless the item is
 Configuration File Format
                                                          reinserted into the cache.
 Retrieving Configuration
                                                      q   File and key dependencies allow the validity of a cache item to be based
Deployment                                                on an external file or on another cache item. If a dependency changes,
                                                          the cache item is invalidated and removed from the cache. For an
 Deploying Applications
                                                          example of how you might use this functionality, consider the following
 Using the Process Model                                  scenario: an application reads financial information from an XML file


http://samples.gotdotnet.com/quickstart/aspplus/doc/datacaching.aspx (1 of 3) [4/02/2002 8:51:42 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors                                         that is periodically updated. The application processes the data in the
                                                         file and creates a graph of objects that represent that data in a
                                                         consumable format. The application caches that data and inserts a
Security                                                 dependency on the file from which the data was read. When the file is
 Security Overview                                       updated, the data is removed from the cache and the application can
                                                         reread it and reinsert the updated copy of the data.
 Authentication & Authorization
 Windows-based Authentication
                                               Using the Data Cache
 Forms-based Authentication
 Authorizing Users and Roles
                                               The following sample shows a simple use of the cache. It executes a database
 User Account Impersonation                    query and caches the result, which it continues to use for the lifetime of the
 Security and WebServices                      application. When you run the sample, note the message at the bottom of the
                                               page. When first requested, it indicates that the data was explicitly retrieved
                                               from the database server. After refreshing the page, the page notes that the
Localization                                   cached copy was used.
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview                                      VB Datacache1.aspx
 Trace Logging to Page Output
 Application-level Trace Logging                       [Run Sample] | [View Source]

Debugging                                      The next example shows a cache item that depends on an XML file. It is similar
 The SDK Debugger                              to the first example, although in this case the data is retrieved from an XML data
                                               source instead of a database server. When the data is cached, the XML file is
                                               added as a dependency.
Performance
 Performance Overview
                                               When a new record is added using the form at the bottom of the page, the XML
 Performance Tuning Tips                       file is updated and the cached item must be recreated.
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability                                  VB Datacache2.aspx
 Transactions
                                                       [Run Sample] | [View Source]
Sample Applications
 A Personalized Portal                         Note that a file dependency is added by using Cache.Insert and supplying a
 An E-Commerce Storefront                      CacheDependency object referencing the XML file.
 A Class Browser Application
 IBuySpy.com
                                                     Cache.Insert("MyData", Source, _
                                                              New CacheDependency(Server.MapPath("authors.xml")))
 Get URL for this page
                                               VB


                                               A cache item can depend on a single or multiple files or keys. As mentioned
                                               previously, an application can also set expiration policy on a cache item. The


http://samples.gotdotnet.com/quickstart/aspplus/doc/datacaching.aspx (2 of 3) [4/02/2002 8:51:42 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                               following code sets an absolute cache expiration time.



                                                     Cache.Insert("MyData", Source, null, _
                                                                  DateTime.Now.AddHours(1), TimeSpan.Zero)


                                               VB


                                               The relevant parameter is the call to DateTime.Now.AddHours(1), which
                                               indicates that the item expires 1 hour from the time it is inserted. The final
                                               argument, TimeSpan.Zero indicates that there is no relative expiration policy
                                               on this item.


                                               The following code shows how to set a relative expiration policy. It inserts an
                                               item that expires 20 minutes after it is last accessed. Note the use of
                                               DateTime.MaxValue, which indicates that there is no absolute expiration policy
                                               on this item.



                                                     Cache.Insert("MyData", Source, null, DateTime.MaxValue, _
                                                                  TimeSpan.FromMinutes(20))


                                               VB


                                               Section Summary

                                                     1. Data caching allows arbitrary objects to be cached programmatically.
                                                     2. The ASP.NET cache supports expiration and dependencies.
                                                     3. The cache is scoped to an application and its lifetime is equivalent to
                                                        the lifetime of the application.




http://samples.gotdotnet.com/quickstart/aspplus/doc/datacaching.aspx (3 of 3) [4/02/2002 8:51:42 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Configuration Overview
 Introduction
 What is ASP.NET?                                    A central requirement of any Web application server is a rich and flexible
                                                     configuration system--one that enables developers to easily associate
 Language Support
                                                     settings with an installable application (without having to "bake" values into
                                                     code) and enables administrators to easily customize these values post-
ASP.NET Web Forms                                    deployment. The ASP.NET configuration system has been designed to meet
                                                     the needs of both of these audiences; it provides a hierarchical
 Introducing Web Forms                               configuration infrastructure that enables extensible configuration data to be
 Working with Server Controls                        defined and used throughout an application, site, and/or machine. It has
 Applying Styles to Controls                         the following qualities that make it uniquely suited to building and
                                                     maintaining Web applications:
 Server Control Form Validation
 Web Forms User Controls
                                                            q   ASP.NET allows configuration settings to be stored together with
 Data Binding Server Controls                                   static content, dynamic pages, and business objects within a
 Server-Side Data Access                                        single application directory hierarchy. A user or administrator
 Data Access and Customization                                  simply needs to copy a single directory tree to set up an ASP.NET
                                                                application on a machine.
 Working with Business Objects
 Authoring Custom Controls
                                                            q   Configuration data is stored in plain text files that are both human-
 Web Forms Controls Reference                                   readable and human-writable. Administrators and developers can
 Web Forms Syntax Reference                                     use any standard text editor, XML parser, or scripting language to
                                                                interpret and update configuration settings.

ASP.NET Web Services                                        q   ASP.NET provides an extensible configuration infrastructure that
 Introducing Web Services                                       enables third-party developers to store their own configuration
 Writing a Simple Web Service                                   settings, define the persistence format of their own configuration
 Web Service Type Marshalling                                   settings, intelligently participate in their processing, and control
                                                                the resulting object model through which those settings are
 Using Data in Web Services                                     ultimately exposed.
 Using Objects and Intrinsics
 The WebService Behavior                                    q   Changes to ASP.NET configuration files are automatically detected
 HTML Pattern Matching                                          by the system and are applied without requiring any user
                                                                intervention (in other words, an administrator does not need to
                                                                restart the Web server or reboot the machine for them to take
ASP.NET Web Applications                                        effect).
 Application Overview
 Using the Global.asax File                                 q   Configuration sections can be locked down when using the
 Managing Application State                                     <location> tag and the allowOverride attribute.

 HttpHandlers and Factories
                                                     To learn more about the ASP.NET configuration system and how it works,
                                                     see Configuration File Format and Retrieving Configuration.
Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/configoverview.aspx (1 of 2) [4/02/2002 8:51:43 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/configoverview.aspx (2 of 2) [4/02/2002 8:51:43 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Configuration File Format
 Introduction
 What is ASP.NET?                         ASP.NET configuration files are XML-based text files--each named web.config--that can appear in any directory
                                          on an ASP.NET Web application server. Each web.config file applies configuration settings to the directory it is
 Language Support
                                          located in and to all virtual child directories beneath it. Settings in child directories can optionally override or
                                          modify settings specified in parent directories. The root configuration file--
ASP.NET Web Forms                         WinNT\Microsoft.NET\Framework\<version>\config\machine.config--provides default configuration settings for
                                          the entire machine. ASP.NET configures IIS to prevent direct browser access to web.config files to ensure that
 Introducing Web Forms                    their values cannot become public (attempts to access them will cause ASP.NET to return 403: Access
 Working with Server Controls             Forbidden).
 Applying Styles to Controls
 Server Control Form Validation           At run time ASP.NET uses these web.config configuration files to hierarchically compute a unique collection of
 Web Forms User Controls                  settings for each incoming URL target request (these settings are calculated only once and then cached across
                                          subsequent requests; ASP.NET automatically watches for file changes and will invalidate the cache if any of the
 Data Binding Server Controls             configuration files change).
 Server-Side Data Access
 Data Access and Customization            For example, the configuration settings for the URL http://myserver/myapplication/mydir/page.aspx would be
 Working with Business Objects            computed by applying web.config file settings in the following order:
 Authoring Custom Controls
 Web Forms Controls Reference                   Base configuration settings for machine.
                                                C:\WinNT\Microsoft.NET\Framework\v.1.00\config\machine.config
 Web Forms Syntax Reference
                                                Overridden by the configuration settings for the site (or the root application).
                                                C:\inetpub\wwwroot\web.config
ASP.NET Web Services
 Introducing Web Services                       Overridden by application configuration settings.
                                                D:\MyApplication\web.config
 Writing a Simple Web Service
 Web Service Type Marshalling                   Overridden by subdirectory configuration settings.
 Using Data in Web Services                     D:\MyApplication\MyDir\web.config
 Using Objects and Intrinsics
 The WebService Behavior                  If a web.config file is present at the root directory for a site, for example "Inetpub\wwwroot", its configuration
                                          settings will apply to every application in that site. Note that the presence of a web.config file within a given
 HTML Pattern Matching                    directory or application root is completely optional. If a web.config file is not present, all configuration settings
                                          for the directory are automatically inherited from the parent directory.
ASP.NET Web Applications
 Application Overview                     Configuration Section Handlers and Sections
 Using the Global.asax File
 Managing Application State               A web.config file is an XML-based text file that can contain standard XML document elements, including well-
                                          formed tags, comments, text, cdata, and so on. The file may be ANSI, UTF-8, or Unicode; the system
 HttpHandlers and Factories
                                          automatically detects the encoding. The root element of a web.config file is always a <configuration> tag.
                                          ASP.NET and end-user settings are then encapsulated within the tag, as follows:
Cache Services
 Caching Overview                               <configuration>
 Page Output Caching                                <!- Configuration settings would go here. -->
                                                </configuration>
 Page Fragment Caching
 Page Data Caching
                                          The <configuration> tag typically contains three different types of elements: 1) configuration section
                                          handler declarations, 2) configuration section groups, and 3) configuration section settings.
Configuration
 Configuration Overview                         q   Configuration section handlers - The ASP.NET configuration infrastructure makes no assumptions
 Configuration File Format                          regarding the file format or supported settings within a web.config file. Instead, it delegates the
                                                    processing of web.config data to configuration section handlers, .NET Framework classes that
 Retrieving Configuration                           implement the IConfigurationSectionHandler interface. An individual
                                                    IConfigurationSectionHandler declaration needs to appear only once, typically in the
                                                    machine.config file. The web.config files in child directories automatically inherit this declaration.
Deployment                                          Configuration section handlers are declared within a web.config file using section tag directives nested
 Deploying Applications                             within a <configSections> tag. Section tags may be further qualified by section group tags to
 Using the Process Model                            organize them into logical groups (see below). Each section tag identifies a tag name denoting a
 Handling Errors                                    specific section of configuration data and an associated IConfigurationSectionHandler class that
                                                    processes it.

Security                                        q   Configuration section groups - ASP.NET configuration allows hierarchical grouping of sections for
 Security Overview                                  organizational purposes. A <sectionGroup> tag may appear inside a <configSections> tag or
 Authentication & Authorization                     inside other <sectionGroup> tags. For example, ASP.NET section handlers all appear within the
                                                    <system.web> section group.
 Windows-based Authentication
 Forms-based Authentication
                                                q   Configuration sections - ASP.NET configuration settings are represented within configuration tag
 Authorizing Users and Roles                        sections, also nested within a <configuration> tag (and optional section group tags). For each
 User Account Impersonation                         configuration section, an appropriate section handler must be defined in the config hierarchy. For
 Security and WebServices                           example, in the sample below, the tag <httpModules> is the configuration section that defines the
                                                    HTTP modules configuration data. The
                                                    System.Configuration.HttpModulesConfigurationHandler class is responsible for interpreting


 http://samples.gotdotnet.com/quickstart/aspplus/doc/configformat.aspx (1 of 4) [4/02/2002 8:51:45 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Localization                                       the content contained within the <httpModules> tag at run time. Note that both the section
                                                   handler definition and the section must have the same section group qualifier (in this case,
 Internationalization Overview
                                                   <system.web>). Also note that tag names are case-sensitive and must be typed exactly as shown.
 Setting Culture and Encoding                      Various attributes and settings for ASP.NET are also case-sensitive and will not be examined by the
 Localizing ASP.NET Applications                   configuration runtime if the case does not match.
 Working with Resource Files
                                               <configuration>

Tracing                                           <configSections>
 Tracing Overview                                   <sectionGroup name="system.web">
                                                      <section
 Trace Logging to Page Output
                                                         name="httpModules"
 Application-level Trace Logging                         type="System.Web.Configuration.HttpModulesConfigurationHandler,System.Web"
                                                      />
                                                    </sectionGroup>
Debugging                                         </configSections>
 The SDK Debugger
                                                  <system.web>
                                                    <httpModules>
Performance                                           <add
 Performance Overview                                    name="CookielessSession"
                                                         type="System.Web.SessionState.CookielessSessionModule,System.Web"
 Performance Tuning Tips                              />
 Measuring Performance                                <add
                                                         name="OutputCache"
                                                         type="System.Web.Caching.OutputCacheModule,System.Web"
ASP to ASP.NET Migration                              />
 Migration Overview                                   <add
                                                         name="Session"
 Syntax and Semantics
                                                         type="System.Web.SessionState.SessionStateModule,System.Web"
 Language Compatibility                               />
 COM Interoperability                                 <add
                                                         name="WindowsAuthentication"
 Transactions
                                                         type="System.Web.Security.WindowsAuthenticationModule,System.Web"
                                                      />
Sample Applications                                   <add
                                                         name="FormsAuthentication"
 A Personalized Portal
                                                         type="System.Web.Security.FormsAuthenticationModule,System.Web"
 An E-Commerce Storefront                             />
 A Class Browser Application                          <add
                                                         name="PassportAuthentication"
 IBuySpy.com                                             type="System.Web.Security.PassportAuthenticationModule,System.Web"
                                                      />
 Get URL for this page                                <add
                                                         name="UrlAuthorization"
                                                         type="System.Web.Security.UrlAuthorizationModule,System.Web"
                                                      />
                                                      <add
                                                         name="FileAuthorization"
                                                         type="System.Web.Security.FileAuthorizationModule,System.Web"
                                                      />
                                                    </httpModules>
                                                  </system.web>

                                               </configuration>


                                          Using Location and Path

                                          By default, all configuration settings defined within the top-level <configuration> tag are applied to the
                                          current directory location of the containing web.config file and to all of the child paths beneath it. You can
                                          optionally apply configuration settings to specific child paths under the current config file by using the
                                          <location> tag with an appropriately constraining path attribute. If the config file is the main machine.config
                                          file, you can apply settings to specific virtual directories or applications. If the config file is a web.config file,
                                          you can apply settings to a specific file, child directory, virtual directory, or application.


                                               <configuration>

                                                  <location path="EnglishPages">
                                                    <system.web>
                                                      <globalization
                                                         requestEncoding="iso-8859-1"
                                                         responseEncoding="iso-8859-1"
                                                      />
                                                    </system.web>
                                                  </location>

                                                  <location path="EnglishPages/OneJapanesePage.aspx">
                                                    <system.web>


 http://samples.gotdotnet.com/quickstart/aspplus/doc/configformat.aspx (2 of 4) [4/02/2002 8:51:45 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                                     <globalization
                                                        requestEncoding="Shift-JIS"
                                                        responseEncoding="Shift-JIS"
                                                     />
                                                   </system.web>
                                                 </location>

                                              </configuration>


                                         Locking down configuration settings

                                         In addition to specifying path information using the <location> tag, you can also specify security so that
                                         settings cannot be overridden by another configuration file further down the configuration hierarchy. To lock
                                         down a group of settings, you can specify an allowOverride attribute on the surrounding <location> tag
                                         and set it to false. The following code locks down impersonation settings for two different applications.


                                              <configuration>

                                                 <location path="app1" allowOverride="false">
                                                   <system.web>
                                                       <identity impersonate="false" userName="app1" password="app1pw" />
                                                   </system.web>
                                                 </location>

                                                 <location path="app2" allowOverride="false">
                                                   <system.web>
                                                       <identity impersonate="false" userName="app2" password="app2pw" />
                                                   </system.web>
                                                 </location>

                                              </configuration>


                                         Note that if a user tries to override these settings in another configuration file, the configuration system will
                                         throw an error:


                                              <configuration>

                                                 <system.web>
                                                     <identity userName="developer" password="loginpw" />
                                                 </system.web>

                                              </configuration>


                                         Standard ASP.NET Configuration Section

                                         ASP.NET ships with a number of standard configuration section handlers that are used to process configuration
                                         settings within web.config files. The following table provides brief descriptions of the sections, along with
                                         pointers to more information.


                                          Section Name            Description
                                          <httpModules>           Responsible for configuring HTTP modules within an application.
                                                                  HTTP modules participate in the processing of every request into
                                                                  an application. Common uses include security and logging.
                                          <httpHandlers>          Responsible for mapping incoming URLs to IHttpHandler
                                                                  classes. Subdirectories do not inherit these settings. Also
                                                                  responsible for mapping incoming URLs to
                                                                  IHttpHandlerFactory classes. Data represented in
                                                                  <httpHandlers> sections are hierarchically inherited by
                                                                  subdirectories. For more information, see the Http Handlers and
                                                                  Factories section of this tutorial.

                                          <sessionState>          Responsible for configuring the session state HTTP module. For
                                                                  more information, see the Managing Application State section of
                                                                  this tutorial.
                                          <globalization>         Responsible for configuring the globalization settings of an
                                                                  application. For more information, see the Localization section of
                                                                  this tutorial.
                                          <compilation>           Responsible for all compilation settings used by ASP.NET. For
                                                                  more information, see the Business Objects and Debugging
                                                                  sections of this tutorial.




http://samples.gotdotnet.com/quickstart/aspplus/doc/configformat.aspx (3 of 4) [4/02/2002 8:51:45 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                         <trace>           Responsible for configuring the ASP.NET trace service. For more
                                                           information, see the Tracing section of this tutorial.

                                         <processModel> Responsible for configuring the ASP.NET process model settings
                                                        on IIS Web server systems.
                                         <browserCaps>     Responsible for controlling the settings of the browser
                                                           capabilities component. For more information, see the Retrieving
                                                           Configuration section of this tutorial.




http://samples.gotdotnet.com/quickstart/aspplus/doc/configformat.aspx (4 of 4) [4/02/2002 8:51:45 AM]
Microsoft ASP.NET QuickStarts Tutorial

    Getting Started                               Retrieving Configuration
      Introduction
      What is ASP.NET?                            ASP.NET allows developers to access configuration settings from within an application either by exposing configuration settings directly (as
                                                  strongly typed properties) or by using general configuration APIs. The following sample shows a page that accesses the <browserCaps>
      Language Support
                                                  configuration section using the Browser property of the System.Web.HttpRequest class. This is a hash table of attributes that reflect
                                                  the capabilities of the browser client that is currently accessing the page. The actual <browserCaps> section data is included in the
    ASP.NET Web Forms                             machine.config file.
      Introducing Web Forms
      Working with Server Controls
      Applying Styles to Controls
      Server Control Form Validation
      Web Forms User Controls
      Data Binding Server Controls
      Server-Side Data Access                              VB BrowsCaps.aspx
      Data Access and Customization
      Working with Business Objects                       [Run Sample] | [View Source]
      Authoring Custom Controls
      Web Forms Controls Reference                In addition to accessing configuration settings, as demonstrated above, developers also can use the
      Web Forms Syntax Reference                  System.Configuration.ConfigurationSettings class to retrieve the data for any arbitrary configuration section. Note that the particular
                                                  object returned by ConfigurationSettings depends on the section handler mapped to the configuration section (see
                                                  IConfigurationSectionHandler.Create). The following code demonstrates how you can access the configuration data exposed for a
    ASP.NET Web Services                          <customconfig> section. In this example, it is assumed that the configuration section handler returns an object of type
                                                  CustomConfigSettings with the property Enabled.
      Introducing Web Services
      Writing a Simple Web Service
      Web Service Type Marshalling                      Dim config As CustomConfigSettings = CType(ConfigurationSettings("customconfig"), CustomConfigSettings)
      Using Data in Web Services
                                                        If config.Enabled = True Then
      Using Objects and Intrinsics                          ' Do something here.
      The WebService Behavior                           End If
      HTML Pattern Matching
                                                  VB
    ASP.NET Web Applications
      Application Overview                        Using Application Settings
      Using the Global.asax File
      Managing Application State                  Configuration files are perfectly suited for storing custom application settings, such as database connection strings, file paths, or remote
                                                  Web Service URLs. The default configuration sections (defined in the machine.config file) include an <appSettings> section that may be
      HttpHandlers and Factories
                                                  used to store these settings as name/value pairs. The following example shows an <appSettings> configuration section that defines
                                                  database connection strings for an application.
    Cache Services
      Caching Overview                                  <configuration>
                                                           <appSettings>
http://samples.gotdotnet.com/quickstart/aspplus/doc/configretrieve.aspx (1 of 3) [4/02/2002 8:51:47 AM]
Microsoft ASP.NET QuickStarts Tutorial
      Page Output Caching                                   <add key="pubs" value="server=(local)\NetSDK;database=pubs;Trusted_Connection=yes" />
                                                            <add key="northwind" value="server=(local)\NetSDK;database=pubs;Trusted_Connection=yes" />
      Page Fragment Caching
                                                          </appSettings>
      Page Data Caching                                 </configuration>


    Configuration                                 The ConfigurationSettings object exposes a special AppSettings property that can be used to retrieve these settings:
      Configuration Overview
      Configuration File Format
                                                        Dim dsn As String = ConfigurationSettings.AppSettings("pubs")
      Retrieving Configuration

                                                  VB
    Deployment
      Deploying Applications
                                                  The following sample illustrates this technique.
      Using the Process Model
      Handling Errors


    Security
      Security Overview
      Authentication & Authorization
      Windows-based Authentication
                                                           VB Config1.aspx
      Forms-based Authentication
      Authorizing Users and Roles                         [Run Sample] | [View Source]
      User Account Impersonation
      Security and WebServices


    Localization
      Internationalization Overview
      Setting Culture and Encoding
      Localizing ASP.NET Applications
      Working with Resource Files


    Tracing
      Tracing Overview
      Trace Logging to Page Output
      Application-level Trace Logging


    Debugging
      The SDK Debugger

http://samples.gotdotnet.com/quickstart/aspplus/doc/configretrieve.aspx (2 of 3) [4/02/2002 8:51:47 AM]
Microsoft ASP.NET QuickStarts Tutorial

    Performance
      Performance Overview
      Performance Tuning Tips
      Measuring Performance


    ASP to ASP.NET Migration
      Migration Overview
      Syntax and Semantics
      Language Compatibility
      COM Interoperability
      Transactions


    Sample Applications
      A Personalized Portal
      An E-Commerce Storefront
      A Class Browser Application
      IBuySpy.com


      Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/configretrieve.aspx (3 of 3) [4/02/2002 8:51:47 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Deploying ASP.NET Applications
 Introduction
 What is ASP.NET?                                  File System Layout of ASP.NET Applications
 Language Support                                  Resolving Class References to Assemblies
                                                   ASP.NET Application Startup and Class Resolution
ASP.NET Web Forms                                  Code Replacement
 Introducing Web Forms                             Section Summary
 Working with Server Controls
 Applying Styles to Controls
 Server Control Form Validation           File System Layout of ASP.NET Applications
 Web Forms User Controls
 Data Binding Server Controls             ASP.NET can be used to host multiple Web applications, each identified using a unique URL prefix
 Server-Side Data Access                  within a Web site (where a Web site is represented on a Web server as a unique HostName/Port
                                          combination). For example, a single Microsoft Internet Information Services (IIS) Web server with
 Data Access and Customization            two mapped IP addresses (one aliased to "www.msn.com" and the other to "intranet") and three
 Working with Business Objects            logical sites (http://intranet, http://www.msn.com, http://www.msn.com port 81) could expose the
 Authoring Custom Controls                following six ASP.NET applications.
 Web Forms Controls Reference
 Web Forms Syntax Reference                      Application URL                           Description
                                                 http://intranet                           "Root" application on intranet site.
ASP.NET Web Services                             http://www.msn.com                        "Root" application on www.msn.com site.
 Introducing Web Services
 Writing a Simple Web Service                    http://www.msn.com:81                     "Root" application on www.msn.com port 81 site.

 Web Service Type Marshalling                    http://intranet/training                  "Training" application on intranet site.
 Using Data in Web Services                      http://intranet/hr                        "HR" application on intranet site.
 Using Objects and Intrinsics
                                                 http://intranet/hr/compensation/          "Compensation" application on intranet site.
 The WebService Behavior
 HTML Pattern Matching
                                          Note: The URL for the compensation application mentioned in the table is rooted within the HR
                                          application URL namespace. However, this URL hierarchy notation does not imply that the
ASP.NET Web Applications                  compensation application is contained or nested within the HR application. Rather, each application
 Application Overview                     maintains an independent set of configuration and class resolution properties; both are logical peer
                                          child sites of the intranet site.
 Using the Global.asax File
 Managing Application State
                                          Each ASP.NET application exposed within a URL namespace is backed using a file system directory
 HttpHandlers and Factories               located on either a local or remote file share. Application directories are not required to be centrally
                                          located within a contiguous part of the file system; they can be scattered throughout a disk. For
                                          example, the ASP.NET applications mentioned previously could be located in the different directories
Cache Services                            listed in the following table.
 Caching Overview
 Page Output Caching
                                                 Application URL                                    Physical path
 Page Fragment Caching
 Page Data Caching                               http://intranet                                    c:\inetpub\wwwroot
                                                 http://www.msn.com                                 c:\inetpub\msnroot
Configuration                                    http://www.msn.com:81                              d:\msnroot81
 Configuration Overview
                                                 http://intranet/training                           d:\serverapps\trainingapp
 Configuration File Format
 Retrieving Configuration                        http://intranet/hr                                 \\billg42\sillystuff\reviews

                                                 http://intranet/hr/compensation/                   c:\inetpub\wwwroot\compensation
Deployment
 Deploying Applications
                                          Resolving Class References to Assemblies
 Using the Process Model
 Handling Errors
                                          Assemblies are the unit of class deployment in the common language runtime. Developers writing
                                          .NET Framework classes using Visual Studio.NET version 7.0 will produce a new assembly with each
                                          Visual Studio project that they compile. Although it is possible to have an assembly span multiple
Security
                                          portable executable (PE) files (several module DLLs), Visual Studio.NET will, by default, compile all
 Security Overview                        assembly code into a single DLL (1 Visual Studio.NET project = 1 .NET Framework assembly = 1
 Authentication & Authorization           physical DLL).
 Windows-based Authentication
 Forms-based Authentication               You can use an assembly on a computer by deploying it into an assembly cache. The assembly cache
                                          can be either global to a computer or local to a particular application. Only code intended to be


 http://samples.gotdotnet.com/quickstart/aspplus/doc/deployment.aspx (1 of 3) [4/02/2002 8:51:49 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Authorizing Users and Roles              shared across multiple applications should be placed in the global system assembly cache. Code
 User Account Impersonation               specific to a particular application, such as most Web application logic, should be deployed in the
                                          application's local assembly cache. One advantage of deploying an assembly within an application's
 Security and WebServices                 local assembly cache is that only code within that application can access it. (This is a nice feature for
                                          scenarios involving ISPs.) It also facilitates side-by-side versioning of the same application because
                                          classes are private to each application version instance.
Localization
 Internationalization Overview
                                          An assembly can be deployed into an application's local assembly cache by simply copying,
 Setting Culture and Encoding             XCOPYing, or FTPing the appropriate files into a directory that has been marked as an "assembly
 Localizing ASP.NET Applications          cache location" for that particular application. No additional registration tool must be run once the
 Working with Resource Files              appropriate files are copied, and no reboot is necessary. This eliminates some of the difficulties
                                          currently associated with deploying COM components within ASP applications (currently, an
                                          administrator must log on to the Web server locally and run Regsvr32.exe).
Tracing
 Tracing Overview                         By default, an ASP.NET application is automatically configured to use the \bin subdirectory, located
 Trace Logging to Page Output             immediately under the application root, as its local assembly cache. The \bin directory is also
                                          configured to deny any browser access so that a remote client cannot download and steal the code.
 Application-level Trace Logging
                                          The following example shows a possible directory layout for an ASP.NET application, where the \bin
                                          directory is immediately under the application root.
Debugging
 The SDK Debugger                              C:\inetpub\wwwroot Web.cfg Default.aspx \bin <= Application assembly
                                               cache directory MyPages.dll MyBizLogic.dll \order SubmitOrder.aspx
                                               OrderFailed.aspx \img HappyFace.gif
Performance                               ASP.NET Application Startup and Class Resolution
 Performance Overview
 Performance Tuning Tips                  ASP.NET applications are lazily constructed the first time a client requests a URL resource from them.
 Measuring Performance                    Each ASP.NET application is launched within a unique application domain (AppDomain)--a new
                                          common language runtime construct that enables process hosts to provide extensive code, security,
                                          and configuration isolation at run time.
ASP to ASP.NET Migration
 Migration Overview
                                          ASP.NET is responsible for manually creating an application domain when a new application is
 Syntax and Semantics                     started. As part of this process, ASP.NET provides configuration settings for the common language
 Language Compatibility                   runtime to use. These settings include:
 COM Interoperability
 Transactions                                   q   The directory paths that make up the local assembly cache. (Note: It is the .NET Framework
                                                    application domain isolation architecture that allows each application to maintain its own
                                                    local assembly cache.)
Sample Applications                             q   The application's security restrictions (what the application can access on the system).
 A Personalized Portal
 An E-Commerce Storefront                 Because ASP.NET does not have compile-time knowledge of any applications you write on top of it, it
                                          cannot use static references to resolve and reference application code. Instead, ASP.NET must use a
 A Class Browser Application
                                          dynamic class/assembly resolution approach to make the transition from the ASP.NET runtime into
 IBuySpy.com                              application code.


 Get URL for this page                    ASP.NET configuration and page activation files will enable you to dynamically reference a target-
                                          compiled .NET Framework class by specifying an assembly and class name combination. The string
                                          format for this union follows the pattern

                                                classname, assemblyname
                                          . The common language runtime can then use this simple string reference to resolve and load the
                                          appropriate class.

                                          Code Replacement

                                          .NET Framework assemblies are typically compiled and deployed into a Windows DLL-based PE
                                          format. When the common language runtime's loader resolves a class implemented within this type
                                          of assembly, it calls the Windows LoadLibrary routine on the file (which locks its access on disk), and
                                          then maps the appropriate code data into memory for run-time execution. Once loaded, the DLL file
                                          will remain locked on disk until the application domain referencing it is either torn down or manually
                                          recycled.


                                          Although ASP.NET cannot prevent the common language runtime from locking a loaded assembly
                                          DLL on disk, it can support you by ensuring that the physical DLLs in a Web application's private
                                          assembly cache are never actually loaded by the runtime. Instead, shadow copies of the assembly
                                          DLLs are made immediately prior to their use. These shadow assemblies--not the original files--are
                                          then locked and loaded by the runtime.




 http://samples.gotdotnet.com/quickstart/aspplus/doc/deployment.aspx (2 of 3) [4/02/2002 8:51:49 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                         Because the original assembly files always remain unlocked, you are free to delete, replace, or
                                         rename them without cycling the Web server or having to use a registration utility. FTP and similar
                                         methods work just fine. ASP.NET maintains an active list of all assemblies loaded within a particular
                                         application's application domain and uses file-change monitoring code to watch for any updates to
                                         the original files.


                                         Section Summary

                                              1. ASP.NET applications are identified by a unique URL and live in the file system of the Web
                                                 server.
                                              2. ASP.NET can use shared assemblies, which reside in the global cache, and application-
                                                 specific assemblies, which reside in the \bin directory of the application's virtual root.
                                              3. ASP.NET applications run in the context of application domains (AppDomains), which
                                                 provide isolation and enforce security restrictions.
                                              4. Classes can be dynamically referenced using "classname, assemblyname".
                                              5. ASP.NET uses shadow copies of assembly files to avoid locking, it and monitors the files so
                                                 that changes are picked up immediately.



                                                               Copyright 2001 Microsoft Corporation. All rights reserved.




http://samples.gotdotnet.com/quickstart/aspplus/doc/deployment.aspx (3 of 3) [4/02/2002 8:51:49 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Using the Process Model
 Introduction
 What is ASP.NET?                                              Process Model Configuration
 Language Support                                              Reactive Process Recycling
                                                               Proactive Process Recycling
ASP.NET Web Forms                                              Logging Process Model Events
 Introducing Web Forms                                         Enabling Web Gardens
 Working with Server Controls                                  Section Summary
 Applying Styles to Controls
 Server Control Form Validation
 Web Forms User Controls                             One of the most important requirements for ASP.NET applications is
 Data Binding Server Controls                        reliability. The architecture of applications running inside the server process
                                                     (in IIS, Inetinfo.exe) does not produce a solid foundation for building
 Server-Side Data Access                             reliable applications that can continue to run over a long period of time.
 Data Access and Customization                       Too many resources are shared on the process level, and it is too easy for
 Working with Business Objects                       an error to bring down the entire server process.

 Authoring Custom Controls
                                                     To solve this problem, ASP.NET provides an out-of-process execution
 Web Forms Controls Reference
                                                     model, which protects the server process from user code. It also enables
 Web Forms Syntax Reference                          you to apply heuristics to the lifetime of the process to improve the
                                                     availability of your Web applications. Using asynchronous interprocess
                                                     communication enables you to provide the best balance of performance,
ASP.NET Web Services                                 scalability, and reliability.
 Introducing Web Services
 Writing a Simple Web Service
                                                     Process Model Configuration
 Web Service Type Marshalling
 Using Data in Web Services
                                                     Process model settings are exposed in the root configuration file for the
 Using Objects and Intrinsics                        computer, Machine.config. The configuration section is named
 The WebService Behavior                             <processModel> and is shown in the following example. The process
                                                     model is enabled by default (enable="true").
 HTML Pattern Matching

                                                           <processModel
ASP.NET Web Applications                                       enable="true"
 Application Overview                                          timeout="infinite"
                                                               idleTimeout="infinite"
 Using the Global.asax File
                                                               shutdownTimeout="0:00:05"
 Managing Application State                                    requestLimit="infinite"
 HttpHandlers and Factories                                    requestQueueLimit="5000"
                                                               memoryLimit="80"
                                                               webGarden="false"
Cache Services                                                 cpuMask="0xffffffff"
 Caching Overview                                              userName=""
                                                               password=""
 Page Output Caching                                           logLevel="errors"
 Page Fragment Caching                                         clientConnectedCheck="0:00:05"
 Page Data Caching                                         />


                                                     Most of these settings control when a new worker process is started to
Configuration                                        serve requests (gracefully taking the place of an old worker process). The
 Configuration Overview                              process model supports two types of recycling: reactive and proactive.
 Configuration File Format
 Retrieving Configuration                            Reactive Process Recycling

Deployment                                           Reactive process recycling occurs when a process is misbehaving or unable
 Deploying Applications                              to serve requests. The process typically displays detectable symptoms,
                                                     such as deadlocks, access violations, memory leaks, and so on, in order to
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/procmodel.aspx (1 of 5) [4/02/2002 8:51:51 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors                                     trigger a process recycle. You can control the conditions that trigger a
                                                     process restart by using the configuration settings described in the
                                                     following table.
Security
 Security Overview
                                                      Setting                     Description
 Authentication & Authorization
 Windows-based Authentication                         requestQueueLimit Handles deadlock conditions. The
                                                                        DWORD value is set to the
 Forms-based Authentication                                             maximum allowed number of
 Authorizing Users and Roles                                            requests in the queue, after which
 User Account Impersonation                                             the worker process is considered
                                                                        to be misbehaving. When the
 Security and WebServices                                               number is exceeded, a new
                                                                        process is launched and the
                                                                        requests are reassigned. The
Localization                                                            default is 5000 requests.
 Internationalization Overview
                                                      memoryLimit                 Handles memory leak conditions.
 Setting Culture and Encoding
                                                                                  The DWORD value is set to the
 Localizing ASP.NET Applications                                                  percentage of physical memory
 Working with Resource Files                                                      that the worker process can
                                                                                  consume before it is considered to
                                                                                  be misbehaving. When that
Tracing                                                                           percentage is exceeded, a new
 Tracing Overview                                                                 process is launched and the
                                                                                  requests are reassigned. The
 Trace Logging to Page Output
                                                                                  default is 80%.
 Application-level Trace Logging
                                                      shutdownTimeout             Specifies the amount of time the
                                                                                  worker process has to shut itself
Debugging                                                                         down gracefully (string value in
 The SDK Debugger                                                                 hr:min:sec format). When the
                                                                                  time out expires, the ASP.NET
                                                                                  ISAPI shuts down the worker
Performance                                                                       process. The default is
                                                                                  "00:00:05".
 Performance Overview
 Performance Tuning Tips
 Measuring Performance                               Proactive Process Recycling

ASP to ASP.NET Migration                             Proactive process recycling restarts the worker process periodically even if
                                                     the process is healthy. This can be a useful way to prevent denials of
 Migration Overview
                                                     service due to conditions the process model is unable to detect. A process
 Syntax and Semantics                                can be restarted after a specific number of requests or after a time-out
 Language Compatibility                              period has elapsed.
 COM Interoperability
 Transactions                                         Setting            Description
                                                      timeout            String value in hr:min:sec format that
Sample Applications                                                      configures the time limit after which a
 A Personalized Portal                                                   new worker process will be launched to
                                                                         take the place of the current one. The
 An E-Commerce Storefront                                                default is infinite, a keyword indicating
 A Class Browser Application                                             that the process should not be restarted.
 IBuySpy.com                                          idleTimeout        String value in hr:min:sec format that
                                                                         configures the amount of inactivity, after
 Get URL for this page                                                   which the worker process is automatically
                                                                         shut down. The default is infinite, a
                                                                         keyword indicating that the process
                                                                         should not be restarted.




http://samples.gotdotnet.com/quickstart/aspplus/doc/procmodel.aspx (2 of 5) [4/02/2002 8:51:51 AM]
Microsoft ASP.NET QuickStarts Tutorial


                                                      requestLimit DWORD value set to the number of
                                                                   requests after which a new worker
                                                                   process will be launched to take the place
                                                                   of the current one. The default is
                                                                   infinite, a keyword indicating that the
                                                                   process should not be restarted.


                                                     Logging Process Model Events

                                                     The process model can write events to the Windows event log when
                                                     process cycling occurs. This is controlled by the logLevel attribute in the
                                                     <processModel> configuration section.


                                                      Setting      Description
                                                      logLevel Controls that process cycling events are
                                                               logged to the event log. The value can be:


                                                                          q   All: All process cycling events are
                                                                              logged.
                                                                          q   None: No events are logged.
                                                                          q   Errors: Only unexpected events are
                                                                              logged.




                                                     When a cycling event occurs, if logging is enabled for that event, the
                                                     following events are written to the application event log.


                                                      Shutdown Reason                  Event Log Type Description
                                                      Unexpected                       Error             The ASP.NET
                                                                                                         worker
                                                                                                         process has
                                                                                                         shut down
                                                                                                         unexpectedly.

                                                      RequestQueueLimit                Error             The ASP.NET
                                                                                                         worker
                                                                                                         process has
                                                                                                         been
                                                                                                         restarted
                                                                                                         because the
                                                                                                         request
                                                                                                         queue limit
                                                                                                         was
                                                                                                         exceeded.

                                                      RequestLimit                     Information       The ASP.NET
                                                                                                         worker
                                                                                                         process has
                                                                                                         been
                                                                                                         restarted
                                                                                                         because the
                                                                                                         request limit
                                                                                                         was
                                                                                                         exceeded.




http://samples.gotdotnet.com/quickstart/aspplus/doc/procmodel.aspx (3 of 5) [4/02/2002 8:51:51 AM]
Microsoft ASP.NET QuickStarts Tutorial


                                                      Timeout                          Information     The ASP.NET
                                                                                                       worker
                                                                                                       process has
                                                                                                       been
                                                                                                       restarted
                                                                                                       because the
                                                                                                       time-out
                                                                                                       interval was
                                                                                                       met.

                                                      IdleTimeout                      Information     The ASP.NET
                                                                                                       worker
                                                                                                       process has
                                                                                                       been shut
                                                                                                       down because
                                                                                                       the idle time-
                                                                                                       out interval
                                                                                                       was met.

                                                      MemoryLimitExceeded Error                        The ASP.NET
                                                                                                       worker
                                                                                                       process was
                                                                                                       restarted
                                                                                                       because the
                                                                                                       process
                                                                                                       memory limit
                                                                                                       was
                                                                                                       exceeded.


                                                     Enabling Web Gardens

                                                     The process model helps enable scalability on multiprocessor computers by
                                                     distributing the work to several processes, one per CPU, each with
                                                     processor affinity set to its CPU. This eliminates cross-processor lock
                                                     contention and is ideal for large SMP systems. This technique is called Web
                                                     gardening. The configuration settings for enabling Web gardens are listed
                                                     in the following table. Note that these settings take effect only after a
                                                     server is restarted. IIS must be cycled in order for this change to take
                                                     place.


                                                      Setting          Description
                                                      webGarden Controls CPU affinity. True indicates that
                                                                processes should be affinitized to the
                                                                corresponding CPU. The default is False.

                                                      cpuMask          Controls the number of processes and how
                                                                       the Web garden works. One process is
                                                                       launched for each CPU where the
                                                                       corresponding bit in the mask set to 1.
                                                                       When UseCPUAffinity is set to 0, the
                                                                       cpuMask setting only controls the number
                                                                       of worker processes (number of bits set to
                                                                       1). The maximum-allowed number of
                                                                       worker processes is the number of CPUs.
                                                                       By default, all CPUs are enabled; the same
                                                                       number of worker processes is launched as
                                                                       there are CPUs. The default value is
                                                                       0xffffffff.


                                                     Web gardening has some side effects that you should be aware of:



http://samples.gotdotnet.com/quickstart/aspplus/doc/procmodel.aspx (4 of 5) [4/02/2002 8:51:51 AM]
Microsoft ASP.NET QuickStarts Tutorial


                                                            q   If your application uses session state, it must choose an out-of-
                                                                process provider (NT Service or SQL).
                                                            q   Application state and application statics are per process, not per
                                                                computer.
                                                            q   Caching is per process, not per computer.


                                                     Section Summary

                                                           1. ASP.NET provides an out-of-process execution model, which
                                                              protects the server process from user code. It also enables you to
                                                              apply heuristics to the lifetime of the process to improve the
                                                              overall availability of Web applications.
                                                           2. The <processModel> settings are exposed in the root
                                                              configuration file for the computer's Machine.config file. The
                                                              process model is enabled by default.
                                                           3. The process model supports two types of recycling: reactive and
                                                              proactive. Reactive process recycling occurs when a process is
                                                              misbehaving or unable to serve requests. Proactive process
                                                              recycling restarts the worker process periodically, even when the
                                                              process may be healthy.
                                                           4. The process model can write events to the Windows event log
                                                              when process cycling occurs. This is controlled by the log-level
                                                              attribute in the <processModel> configuration section.
                                                           5. The process model helps enable scalability on multiprocessor
                                                              computers by distributing the work to several processes, one per
                                                              CPU, each with processor affinity set to its CPU. This technique is
                                                              called Web gardening.



                                                                Copyright 2001 Microsoft Corporation. All rights reserved.




http://samples.gotdotnet.com/quickstart/aspplus/doc/procmodel.aspx (5 of 5) [4/02/2002 8:51:51 AM]
Microsoft ASP.NET QuickStarts Tutorial

    Getting Started                             Handling Errors
      Introduction
      What is ASP.NET?                                    Customizing Error Pages
      Language Support                                    Handling Errors Programmatically
                                                          Writing to the Event Log
    ASP.NET Web Forms                                     Section Summary
      Introducing Web Forms
      Working with Server Controls
      Applying Styles to Controls
      Server Control Form Validation            When an error occurs on a page, ASP.NET sends information about the error to the client. Errors are divided into four categories:
      Web Forms User Controls
      Data Binding Server Controls                    q   Configuration errors: Occur when the syntax or structure of a Web.config file in the configuration hierarchy is incorrect.
      Server-Side Data Access                         q   Parser errors: Occur when the ASP.NET syntax on a page is malformed.
                                                      q   Compilation errors: Occur when statements in a page's target language are incorrrect.
      Data Access and Customization
                                                      q   Run-time errors: Occur during a page's execution, even though the errors could not be detected at compile time.
      Working with Business Objects
      Authoring Custom Controls                           By default, the information shown for a run-time error is the call stack (the chains of procedure calls leading up to the exception). If
      Web Forms Controls Reference                        debug mode is enabled, ASP.NET displays the line number in source code where the run-time error originated. Debug mode is a valuable
      Web Forms Syntax Reference                          tool for debugging your application. You can enable debug mode at the page level, using the following directive:


                                                               <%@ Page Debug="true" %>
    ASP.NET Web Services
      Introducing Web Services
                                                          You can also enable debug mode at the application level, using the Web.config file in the application's root directory, as shown in the
      Writing a Simple Web Service                        following example.
      Web Service Type Marshalling
      Using Data in Web Services                          Note: Running debug mode incurs a heavy performance penalty. Be sure to disable it before deploying your finished application.
      Using Objects and Intrinsics
      The WebService Behavior                             The following example demonstrates the use of debug mode to show source line numbers for a run-time exception.
      HTML Pattern Matching


    ASP.NET Web Applications
      Application Overview
      Using the Global.asax File
      Managing Application State
      HttpHandlers and Factories                                  VB Error1.aspx


    Cache Services                                               [Run Sample] | [View Source]
      Caching Overview
      Page Output Caching                                 Customizing Error Pages
      Page Fragment Caching
http://samples.gotdotnet.com/quickstart/aspplus/doc/handlingerrs.aspx (1 of 7) [4/02/2002 8:51:54 AM]
Microsoft ASP.NET QuickStarts Tutorial
      Page Data Caching                                  Depending on the circumstances, you might want to handle application errors in different ways. For example, at development time you
                                                         probably want to see the detailed error pages that ASP.NET provides to help you identify and fix problems. However, once an application
                                                         is being served in a production environment, you probably do not want to display detailed errors to your customer clients. You can use
    Configuration                                        ASP.NET to specify whether errors are shown to local clients, to remote clients, or to both. By default, errors are shown only to local
      Configuration Overview                             clients (those clients on the same computer as the server). You can also specify a custom error page to redirect clients to if an error
      Configuration File Format                          occurs.
      Retrieving Configuration
                                                         Custom errors are enabled in the Web.config file for an application. For example:

    Deployment
                                                               <configuration>
      Deploying Applications
                                                                    <system.web>
      Using the Process Model                                           <customErrors defaultRedirect="genericerror.htm" mode="remoteonly" />
      Handling Errors                                               </system.web>
                                                               </configuration>

    Security
                                                         This configuration enables local clients to see the default ASP.NET detailed error pages but redirects remote clients to a custom page,
      Security Overview                                  genericerror.htm. This page could be an .aspx page as well. ASP.NET passes the path of the page on which the error occurred to the
      Authentication & Authorization                     error page as a QueryString argument. Note that if the execution of the error page generates an error, a blank page is sent back to the
      Windows-based Authentication                       remote client.
      Forms-based Authentication
      Authorizing Users and Roles                              <%@ Page Language="VB" Description="Error page"%>
      User Account Impersonation
                                                               <html>
      Security and WebServices
                                                               <head>
                                                               <title>Error page</title>
    Localization                                               </head>
      Internationalization Overview                            <body>
      Setting Culture and Encoding                             <h1>Error page</h1>
                                                               Error originated on: <%=Request.QueryString("ErrorPage") %>
      Localizing ASP.NET Applications
                                                               </body>
      Working with Resource Files                              </html>


    Tracing                                              VB
      Tracing Overview
      Trace Logging to Page Output                       Note: Only files mapped to the XSPISAPI.dll extension in IIS generate these errors. Files not served through the XSPISAPI.dll are not
      Application-level Trace Logging                    processed by ASP.NET and generate IIS errors. See the IIS documentation for information about configuring IIS custom errors.


                                                         The following table describes the configuration attributes and values for the <customerrors> tag.
    Debugging
      The SDK Debugger
                                                          Attribute             Description

    Performance                                           Mode                  Indicates whether custom errors are enabled, disabled, or only shown to remote
      Performance Overview                                                      computers. Values: On, Off, RemoteOnly (default).


http://samples.gotdotnet.com/quickstart/aspplus/doc/handlingerrs.aspx (2 of 7) [4/02/2002 8:51:54 AM]
Microsoft ASP.NET QuickStarts Tutorial
      Performance Tuning Tips                             DefaultRedirect Indicates the default URL to which a browser should be redirected if an error occurs.
      Measuring Performance                                               This attribute is optional.


    ASP to ASP.NET Migration                             The Mode attribute determines whether errors are shown to local clients, remote clients, or both. The effects of each setting are
      Migration Overview                                 described in the following table.
      Syntax and Semantics
      Language Compatibility                              Mode                     Local host request                               Remote host request
      COM Interoperability
                                                          On                       Custom error page.                               Custom error page.
      Transactions
                                                          Off                      ASP.NET error page.                              ASP.NET error page.

                                                          RemoteOnly               ASP.NET error page.                              Custom error page.
    Sample Applications
      A Personalized Portal
      An E-Commerce Storefront                           The following sample demonstrates how the <customerrors> configuration section is used.
      A Class Browser Application
      IBuySpy.com


      Get URL for this page



                                                                 VB Custom1.aspx

                                                                 [Run Sample] | [View Source]


                                                         In addition to redirecting to a common page for all errors, you can also assign specific error pages to specific error status codes. The
                                                         <customerrors> configuration section supports an inner <error> tag that associates HTTP status codes with custom error pages. For
                                                         example:


                                                                <configuration>
                                                                  <system.web>
                                                                    <customerrors mode="remoteonly" defaultredirect="/genericerror.htm">
                                                                      <error statuscode="500" redirect="/error/callsupport.htm"/>
                                                                      <error statuscode="404" redirect="/error/notfound.aspx"/>
                                                                      <error statuscode="403" redirect="/error/noaccess.aspx"/>
                                                                    </customerrors>
                                                                  </system.web>
                                                                </configuration>


                                                         The following table describes the attributes and values for the <error> tag.


                                                          Attribute            Description

http://samples.gotdotnet.com/quickstart/aspplus/doc/handlingerrs.aspx (3 of 7) [4/02/2002 8:51:54 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                                          StatusCode           HTTP status code of errors for which the custom error page should be used. Examples:
                                                                               403 Forbidden, 404 Not Found, or 500 Internal Server Error.
                                                          Redirect             URL to which the client browser should be redirected if an error occurs.


                                                         The following example demonstrates how to use the <error> tag. Note that the example specifies an .aspx page for "File Not Found"
                                                         errors so that the missing page URL passed via the QueryString can be printed.




                                                                 VB Custom1.aspx

                                                                [Run Sample] | [View Source]


                                                         Handling Errors Programmatically

                                                         You can also handle errors in code, at either the page level or the application level. The Page base class exposes a Page_Error method,
                                                         which you can override in your pages. The method is called whenever an uncaught exception is thrown at run time.



                                                               <script language="C#" runat="server">

                                                               Sub Page_Error(Source As Object, E As EventArgs)
                                                                   Dim message As String = "<font face=verdana color=red>" _
                                                                                          & "<h4>" & Request.Url.ToString() & "</h4>" _
                                                                                          & "<pre><font color='red'>" & Server.GetLastError().ToString() & "</pre>" _
                                                                                          & "</font>"

                                                                   Response.Write(message)
                                                               End Sub

                                                               </script>


                                                         VB


                                                         The following sample demonstrates the Page_Error method.




http://samples.gotdotnet.com/quickstart/aspplus/doc/handlingerrs.aspx (4 of 7) [4/02/2002 8:51:54 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                                                 VB Error2.aspx

                                                                [Run Sample] | [View Source]


                                                         You could do something useful in this method, like sending an e-mail to the site administrator saying that the page failed to execute
                                                         properly. ASP.NET provides a set of classes in the System.Web.Mail namespace for just this purpose. To import this namespace, use an
                                                         @Import directive at the top of your page, as follows:


                                                               <%@ Import Namespace="System.Web.Mail" %>


                                                         You can then use the MailMessage and SmtpMail objects to programmatically send e-mail.



                                                               Dim mail As New MailMessage
                                                               mail.From = "automated@yourservername.com"
                                                               mail.To = "administrator@yourservername.com"
                                                               mail.Subject = "Site Error"
                                                               mail.Body = message
                                                               mail.BodyFormat = MailFormat.Html
                                                               SmtpMail.Send(mail)


                                                         VB


                                                         The following sample shows how to send a mail message in response to a page error.


                                                         Note: This sample does not actually send mail unless you have configured the SMTP mail service on your machine. For more information
                                                         about the SMTP mail service, consult the IIS documentation.




                                                                 VB Error3.aspx

                                                                [Run Sample] | [View Source]
http://samples.gotdotnet.com/quickstart/aspplus/doc/handlingerrs.aspx (5 of 7) [4/02/2002 8:51:54 AM]
Microsoft ASP.NET QuickStarts Tutorial


                                                         In addition to handling errors at the page level, you might want to handle errors at the application level. To do this, use the
                                                         Application_Error event in Global.asax. This event occurs for any unhandled exception thrown within the application.



                                                               Sub Application_Error(sender As Object, e As EventArgs)
                                                                   '...Do something here
                                                               End Sub


                                                         VB


                                                         Writing to the Event Log

                                                         The System.Diagnostics namespace provides classes for writing to the Windows event log. To use this namespace in your pages, you
                                                         must first import the namespace, as follows:


                                                               <%@ Import Namespace="System.Diagnostics"%>


                                                         The EventLog class encapsulates the log itself. It provides static methods for detecting or creating logs and can be instantiated to write
                                                         log entries from code. The following example shows this functionality within the Application_Error method of Global.asax. Whenever an
                                                         unhandled exception occurs in the application, an entry containing the error message and stack trace is made to the application log.



                                                               Sub Application_Error(sender As Object, e As EventArgs)

                                                                     Dim Message As String = "\n\nURL:\n http://localhost/" & Request.Path _
                                                                                                       & "\n\nMESSAGE:\n " & Server.GetLastError().Message _
                                                                                                       & "\n\nSTACK TRACE:\n" & Server.GetLastError().StackTrace

                                                                    ' Create event log if it does not exist

                                                                     Dim LogName As String = "Application"
                                                                     If (Not EventLog.SourceExists(LogName))
                                                                        EventLog.CreateEventSource(LogName, LogName)
                                                                     End If

                                                                     ' Insert into event log
                                                                     Dim Log As New EventLog
                                                                     Log.Source = LogName
                                                                     Log.WriteEntry(Message, EventLogEntryType.Error)

                                                               End Sub


                                                         VB


                                                         The complete source code for the preceding example follows. Note that this code is disabled so that it cannot run here, to prevent entries

http://samples.gotdotnet.com/quickstart/aspplus/doc/handlingerrs.aspx (6 of 7) [4/02/2002 8:51:54 AM]
Microsoft ASP.NET QuickStarts Tutorial
                                                         to your Windows event log. If you would like to see this code run, create an IIS virtual root pointing to the directory that contains this file.




                                                                 VB Global.asax

                                                                [View Source]


                                                         Section Summary

                                                               1. Errors are divided into four categories: configuration errors, parser errors, compilation errors, and run-time errors.
                                                               2. By default, the information shown for a run-time error is the call stack (the chain of procedure calls leading up to the exception).
                                                                  If debug mode is enabled, ASP.NET displays the line number in source code where the run-time error originated.
                                                               3. ASP.NET enables you to specify whether errors are shown to local clients, to remote clients, or to both. By default, errors are
                                                                  only shown to local clients (clients on the same computer as the server). You can also specify a custom error page to redirect
                                                                  clients to if an error occurs.
                                                               4. In addition to redirecting to a common page for all errors, you can also assign specific error pages to specific error status codes.
                                                                  The <customerrors> configuration section supports an inner <error> tag for associating HTTP status codes with custom
                                                                  error pages.
                                                               5. You can also handle errors in code, at either the page level or application level. The Page base class exposes a HandleError
                                                                  method, which you can override in your pages. The method will be called whenever an uncaught exception is thrown at run
                                                                  time.
                                                               6. The System.Web.Mail namespace exposes classes for programmatically sending e-mail. This is useful for notifying an
                                                                  administrator when an error occurs.
                                                               7. In addition to handling errors at the page level, you can use the Application_Error event in Global.asax to handle errors at the
                                                                  application level. This event will occur for any unhandled exception thrown within the application.
                                                               8. The System.Diagnostics namespace provides classes for writing to the Windows event log.



                                                                                                   Copyright 2001 Microsoft Corporation. All rights reserved.




http://samples.gotdotnet.com/quickstart/aspplus/doc/handlingerrs.aspx (7 of 7) [4/02/2002 8:51:54 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Security Overview
 Introduction
 What is ASP.NET?                                    An important part of many Web applications is the ability to identify users
                                                     and control access to resources. The act of determining the identity of the
 Language Support
                                                     requesting entity is known as authentication. Generally, the user must
                                                     present credentials, such as a name/password pair in order to be
ASP.NET Web Forms                                    authenticated. Once an authenticated identity is available, it must be
                                                     determined whether that identity can access a given resource. This process
 Introducing Web Forms                               is known as authorization. ASP.NET works in conjunction with IIS to
 Working with Server Controls                        provide authentication and authorization services to applications.
 Applying Styles to Controls
 Server Control Form Validation                      An important feature of COM objects is the ability to control the identity
 Web Forms User Controls                             under which COM object code is executed. When a COM object executes
                                                     code with the identity of the requesting entity, this is known as
 Data Binding Server Controls                        impersonation. ASP.NET applications can optionally choose to impersonate
 Server-Side Data Access                             requests.
 Data Access and Customization
 Working with Business Objects                       Some applications also want to be able to dynamically tailor content, based
                                                     on the requesting identity or based on a set of roles that a requesting
 Authoring Custom Controls
                                                     identity belongs to. ASP.NET applications can dynamically check whether
 Web Forms Controls Reference                        the current requesting identity participates in a particular role. For
 Web Forms Syntax Reference                          example, an application might want to check to see whether the current
                                                     user belongs to the manager's role, in order to conditionally generate
                                                     content for managers.
ASP.NET Web Services
 Introducing Web Services
 Writing a Simple Web Service
 Web Service Type Marshalling
 Using Data in Web Services
 Using Objects and Intrinsics
 The WebService Behavior
 HTML Pattern Matching


ASP.NET Web Applications
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/securityoverview.aspx (1 of 2) [4/02/2002 8:51:55 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/securityoverview.aspx (2 of 2) [4/02/2002 8:51:55 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Authentication and Authorization
 Introduction
 What is ASP.NET?                                    ASP.NET works in conjunction with IIS to support authentication, using
                                                     Basic, Digest, and Windows authentication. ASP.NET supports the Microsoft
 Language Support
                                                     Passport authentication service, which provides single sign-on services and
                                                     support for user profile services. ASP.NET also provides a robust service for
ASP.NET Web Forms                                    applications that want to use forms-based authentication. Forms-based
                                                     authentication uses cookies to authenticate users and allows the application
 Introducing Web Forms                               to do its own credential verification.
 Working with Server Controls
 Applying Styles to Controls                         It is important to realize that ASP.NET authentication services are subject
 Server Control Form Validation                      to the authentication services provided by IIS. For example, in order to use
 Web Forms User Controls                             Basic authentication in an IIS application, you must configure the use of
                                                     Basic authentication for the application using the Internet Service Manager
 Data Binding Server Controls                        tool.
 Server-Side Data Access
 Data Access and Customization                       ASP.NET provides two types of authorization services:
 Working with Business Objects
 Authoring Custom Controls                                  q   Checks against ACLs or permissions on a resource to determine
 Web Forms Controls Reference                                   whether the authenticated user account can access the resources
                                                            q   URL authorization, which authorizes an identity for pieces of the
 Web Forms Syntax Reference                                     Web space


ASP.NET Web Services                                 To illustrate the difference, consider a scenario in which an application is
 Introducing Web Services                            configured to allow anonymous access using the IUSR_MYMACHINE
                                                     account. When a request for an ASP.NET page (such as "/default.aspx") is
 Writing a Simple Web Service
                                                     authorized, a check is done against the ACLs on that file (for example,
 Web Service Type Marshalling                        "c:\inetpub\wwwroot\default.aspx") to see whether the IUSR_MYMACHINE
 Using Data in Web Services                          account has permission to read the file. If it does, then access is
                                                     authorized. File authorization is performed automatically.
 Using Objects and Intrinsics
 The WebService Behavior
                                                     For URL authorization, the anonymous user is checked against the
 HTML Pattern Matching
                                                     configuration data computed for the ASP.NET application. If access is
                                                     allowed for the requested URL, the request is authorized. In this case,
                                                     ASP.NET checks to see whether the anonymous user has access to
ASP.NET Web Applications
                                                     /Default.aspx (that is, the check is done against the URL itself, not against
 Application Overview                                the file that the URL ultimately resolves to).
 Using the Global.asax File
 Managing Application State                          This might seem a subtle distinction, but it enables applications to use
 HttpHandlers and Factories                          authentication schemes likes forms-based authentication or Passport
                                                     authentication, in which the users do not correspond to a machine or
                                                     domain account. It also enables authorization against virtual resources, for
Cache Services                                       which there is no physical file underlying the resource. For example, an
 Caching Overview                                    application could choose to map all requests for files ending in .stk to a
                                                     handler that serves stock quotes based on variables present in the query
 Page Output Caching
                                                     string. In such a case, there is no physical .stk against which to do ACL
 Page Fragment Caching                               checks, so URL authorization is used to control access to the virtual
 Page Data Caching                                   resource.


                                                     File authorization is always performed against the authenticated account
Configuration                                        provided by IIS. If anonymous access is allowed, this is the configured
 Configuration Overview                              anonymous account. Otherwise, it uses an NT account. This works in
 Configuration File Format                           exactly the same way as ASP.
 Retrieving Configuration
                                                     File ACLs are set for a given file or directory using the Security tab in the
                                                     Explorer property page. URL authorization is configured as part of an
Deployment                                           ASP.NET application and is described fully in Authorizing Users and Roles.
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/authandauth.aspx (1 of 2) [4/02/2002 8:51:57 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors                                     To activate an ASP.NET authentication service, you must configure the
                                                     <authentication> element in the application's configuration file. This
                                                     element can have any of the values listed in the following table.
Security
 Security Overview
                                                      Value        Description
 Authentication & Authorization
 Windows-based Authentication                         None         No ASP.NET authentication services are active.
                                                                   Note that IIS authentication services can still be
 Forms-based Authentication                                        present.
 Authorizing Users and Roles
                                                      Windows ASP.NET authentication services attach a
 User Account Impersonation                                   WindowsPrincipal
 Security and WebServices                                     (System.Security.Principal.WindowsPrincipal)
                                                              to the current request to enable authorization
                                                              against NT users or groups.
Localization
                                                      Forms        ASP.NET authentication services manage cookies
 Internationalization Overview
                                                                   and redirect unathenticated users to a logon page.
 Setting Culture and Encoding                                      This is often used in conjunction with the IIS
 Localizing ASP.NET Applications                                   option to allow anonymous access to an
                                                                   application.
 Working with Resource Files
                                                      Passport ASP.NET authentication services provide a
                                                               convenient wrapper around the services provided
Tracing                                                        by the Passport SDK, which must be installed on
 Tracing Overview                                              the machine.
 Trace Logging to Page Output
 Application-level Trace Logging
                                                     For example, the following configuration file enables forms-based (cookie)
                                                     authentication for an application:
Debugging
 The SDK Debugger                                          <configuration>
                                                             <system.web>
                                                               <authentication mode="Forms"/>
Performance                                                  </system.web>
 Performance Overview                                      </configuration>
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/authandauth.aspx (2 of 2) [4/02/2002 8:51:57 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                    Windows-based Authentication
 Introduction
 What is ASP.NET?                  When you use ASP.NET Windows authentication, ASP.NET attaches a WindowsPrincipal object to the current request. This object is
                                   used by URL authorization. The application can also use it programatically to determine whether a requesting identity is in a given role.
 Language Support


ASP.NET Web Forms                       If User.IsInRole("Administrators") Then
 Introducing Web Forms                      DisplayPrivilegedContent()
                                        End If
 Working with Server Controls
 Applying Styles to Controls
                                   VB
 Server Control Form Validation
 Web Forms User Controls
                                   The WindowsPrincipal class determines roles by NT group membership. Applications that want to determine their own roles can do so
 Data Binding Server Controls      by handling the WindowsAuthentication_OnAuthenticate event in their Global.asax file and attaching their own class that
 Server-Side Data Access           implements System.Security.Principal.IPrincipal to the request, as shown in the following example:
 Data Access and Customization
 Working with Business Objects
                                        ' Create a class that implements IPrincipal
 Authoring Custom Controls              Public Class MyPrincipal : Inherits IPrincipal
 Web Forms Controls Reference             ' Implement application-defined role mappings
 Web Forms Syntax Reference             End Class

                                        ' In a Global.asax file
ASP.NET Web Services                    Public Sub WindowsAuthentication_OnAuthenticate(Source As Object, e As WindowsAuthenticationEventArgs)
                                          ' Attach a new application-defined class that implements IPrincipal to
 Introducing Web Services                 ' the request.
 Writing a Simple Web Service             ' Note that since IIS has already performed authentication, the provided
 Web Service Type Marshalling             ' identity is used.
                                          e.User = New MyPrincipal(e.Identity)
 Using Data in Web Services             End Sub
 Using Objects and Intrinsics
 The WebService Behavior           VB
 HTML Pattern Matching
                                   The following sample shows how to access the name of an authenticated user, which is available as User.Identity.Name. Programmers
ASP.NET Web Applications           familiar with ASP should note that this value is also still available as the AUTH_USER server variable:
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview                          VB Windows Authentication
 Page Output Caching
 Page Fragment Caching
                                          [Run Sample] | [View Source]
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model
 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


 http://samples.gotdotnet.com/quickstart/aspplus/doc/windowsauth.aspx (1 of 2) [4/02/2002 8:51:58 AM]
 Microsoft ASP.NET QuickStarts Tutorial


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


Get URL for this page




 http://samples.gotdotnet.com/quickstart/aspplus/doc/windowsauth.aspx (2 of 2) [4/02/2002 8:51:58 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                    Forms-Based Authentication
 Introduction
 What is ASP.NET?                  Forms-based authentication is an ASP.NET authentication service that enables applications to provide their own logon UI and
                                   do their own credential verification. ASP.NET authenticates users, redirecting unauthenticated users to the logon page, and
 Language Support
                                   performing all the necessary cookie management. This sort of authentication is a popular technique used by many Web sites.

ASP.NET Web Forms                  An application has to be configured to use forms-based authentication by setting <authentication> to Forms, and denying
 Introducing Web Forms             access to anonymous users. The following example shows how this can be done in the Web.config file for the desired
 Working with Server Controls      application:

 Applying Styles to Controls
 Server Control Form Validation           <configuration>
 Web Forms User Controls                    <system.web>
 Data Binding Server Controls                 <authentication mode="Forms"/>
                                              <authorization>
 Server-Side Data Access                          <deny users="?" />
 Data Access and Customization                </authorization>
 Working with Business Objects              </system.web>
                                          </configuration>
 Authoring Custom Controls
 Web Forms Controls Reference
                                   Administrators use forms-based authentication to configure the name of the cookie to use, the protection type, the URL to use
 Web Forms Syntax Reference        for the logon page, length of time the cookie is in effect, and the path to use for the issued cookie. The following table shows
                                   the valid attributes for the <Forms> element, which is a sub-element of the <authentication> element shown in the
                                   following example:
ASP.NET Web Services
 Introducing Web Services
 Writing a Simple Web Service             <authentication mode="Forms">
 Web Service Type Marshalling                <forms name=".ASPXCOOKIEDEMO" loginUrl="login.aspx" protection="all" timeout="30" path="/">
                                                              <!-- protection="[All|None|Encryption|Validation]" -->
 Using Data in Web Services
                                             </forms>
 Using Objects and Intrinsics             </authentication>
 The WebService Behavior            Attribute                           Description
 HTML Pattern Matching
                                    loginUrl                            Logon URL to which unauthenticated users are redirected. This can be
                                                                        on the same computer or a remote one. If it is on a remote computer,
ASP.NET Web Applications                                                both computers need to be using the same value for the decryptionkey
                                                                        attribute.
 Application Overview
 Using the Global.asax File         name                                Name of the HTTP cookie to use for authentication purposes. Note that if
                                                                        more than one application wants to use forms-based authentication
 Managing Application State
                                                                        services on a single computer, they should each configure a unique
 HttpHandlers and Factories                                             cookie value. In order to avoid causing dependencies in URLs, ASP.NET
                                                                        uses "/" as the Path value when setting authentication cookies, so that
                                                                        they are sent back to every application on the site.
Cache Services
 Caching Overview                   timeout                             Amount of time in integer minutes, after which the cookie expires. The
                                                                        default value is 30. The timeout attribute is a sliding value, expiring n
 Page Output Caching                                                    minutes from the time the last request was received. In order to avoid
 Page Fragment Caching                                                  adversely affecting performance and to avoid multiple browser warnings
 Page Data Caching                                                      for those who have cookies warnings turned on, the cookie is updated if
                                                                        the time is more than half gone. (This means a loss of possible precision
                                                                        in some cases.)
Configuration                       path                                Path to use for the issued cookie. The default value is "/" to avoid
 Configuration Overview                                                 difficulties with mismatched case in paths, since browsers are strictly
 Configuration File Format                                              case-sensitive when returning cookies. Applications in a shared-server
                                                                        environment should use this directive to maintain private cookies.
 Retrieving Configuration
                                                                        (Alternatively, they can specify the path at runtime using the APIs to
                                                                        issue cookies.)
Deployment                          protection                          Method used to protect cookie data. Valid values are as follows:
 Deploying Applications
 Using the Process Model                                                      q   All: Use both data validation and encryption to protect the
 Handling Errors                                                                  cookie. The configured data validation algorithm is based on the
                                                                                  element. Triple DES is used for encryption, if available and if the
                                                                                  key is long enough (48 bytes). All is the default (and
Security                                                                          suggested) value.
 Security Overview                                                            q   None: Use for sites that are only using cookies for
                                                                                  personalization and have weaker security requirements. Both
 Authentication & Authorization
                                                                                  encryption and validation can be disabled. Although you should
 Windows-based Authentication                                                     use caution if you use cookies in this way, this setting provides
 Forms-based Authentication                                                       the best performance of any method of doing personalization
                                                                                  using the .NET Framework.
 Authorizing Users and Roles
                                                                              q   Encryption: Encrypts the cookie using TripleDES or DES, but
 User Account Impersonation                                                       data validation is not done on the cookie. This type of cookie
 Security and WebServices                                                         can be subject to chosen plaintext attacks.
                                                                              q   Validation: Does not encrypt the contents of the cookie, but
                                                                                  validates that the cookie data has not been altered in transit. To
Localization                                                                      create the cookie, the validation key is concatenated in a buffer
 Internationalization Overview                                                    with the cookie data and a MAC is computed and appended to
                                                                                  the outgoing cookie.
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files
                                   After the application has been configured, you need to provide a logon page. The following example shows a simple logon


 http://samples.gotdotnet.com/quickstart/aspplus/doc/formsauth.aspx (1 of 2) [4/02/2002 8:52:00 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Tracing                            page. When the sample is run, it requests the Default.aspx page. Unauthenticated requests are redirected to the logon page
                                   (Login.aspx), which presents a simple form that prompts for an e-mail address and a password. (Use
 Tracing Overview
                                   Username="jdoe@somewhere.com" and Password="password" as credentials.)
 Trace Logging to Page Output
 Application-level Trace Logging   After validating the credentials, the application calls the following:


Debugging
                                          FormsAuthentication.RedirectFromLoginPage(UserEmail.Value, PersistCookie.Checked)
 The SDK Debugger

                                   VB
Performance
 Performance Overview
                                   This redirects the user back to the originally requested URL. Applications that do not want to perform the redirection can call
 Performance Tuning Tips           either FormsAuthentication.GetAuthCookie to retrieve the cookie value or FormsAuthentication.SetAuthCookie to
 Measuring Performance             attach a properly encrypted cookie to the outgoing response. These techniques can be useful for applications that provide a
                                   logon UI embedded in the containing page or that want to have more control over where users are redirected. Authentication
                                   cookies can either be temporary or permanent ("persistent"). Temporary cookies last only for the duration of the current
ASP to ASP.NET Migration           browser session. When the browser is closed, the cookie is lost. Permanent cookies are saved by the browser and are sent
 Migration Overview                back across browser sessions unless explicitly deleted by the user.
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal                      VB Forms-Based/Cookie Authentication
 An E-Commerce Storefront
 A Class Browser Application                [Run Sample] | [View Source]
 IBuySpy.com
                                   The authentication cookie used by forms authentication consists of a linear version of the
                                   System.Web.Security.FormsAuthenticationTicket class. The information includes the user name (but not the password),
Get URL for this page
                                   the version of forms authentication used, the date the cookie was issued, and a field for optional application-specific data.


                                   Application code can revoke or remove authentication cookies using the FormsAuthentication.SignOut method. This
                                   removes the authentication cookie regardless of whether it is temporary or permanent.


                                   It is also possible to supply forms-based authentication services with a list of valid credentials using configuration, as shown in
                                   the following example:



                                          <authentication>
                                              <credentials passwordFormat="SHA1" >
                                                  <user name="Mary" password="GASDFSA9823598ASDBAD"/>
                                                  <user name="John" password="ZASDFADSFASD23483142"/>
                                              </credentials>
                                          </authentication>


                                   The application can then call FormsAuthentication.Authenticate, supplying the username and password, and ASP.NET will
                                   verify the credentials. Credentials can be stored in cleartext, or as SHA1 or MD5 hashes, according to the following values of
                                   the passwordFormat attribute:


                                    Hash Type                             Description
                                    Clear                                 Passwords are stored in cleartext

                                    SHA1                                  Passwords are stored as SHA1 digests
                                    MD5                                   Passwords are stored as MD5 digests




 http://samples.gotdotnet.com/quickstart/aspplus/doc/formsauth.aspx (2 of 2) [4/02/2002 8:52:00 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                       Authorizing Users and Roles
 Introduction
 What is ASP.NET?                                     ASP.NET is used to control client access to URL resources. It is configurable
                                                      for the HTTP method used to make the request (GET or POST) and can be
 Language Support
                                                      configured to allow or deny access to groups of users or roles. The
                                                      following example shows access being granted to a user named John and a
ASP.NET Web Forms                                     role named Admins. All other users are denied access.
 Introducing Web Forms                                      <authorization>
 Working with Server Controls                                   <allow users="jdoe@somewhere.com" />
                                                                <allow roles="Admins" />
 Applying Styles to Controls
                                                                <deny users="*" />
 Server Control Form Validation                             </authorization>
 Web Forms User Controls
 Data Binding Server Controls                         Permissible elements for authorization directives are either allow or deny.
 Server-Side Data Access                              Each allow or deny element must contain a users or a roles attribute.
                                                      Multiple users or roles can be specified in a single element by providing a
 Data Access and Customization
                                                      comma-separated list.
 Working with Business Objects
 Authoring Custom Controls
 Web Forms Controls Reference                               <allow users="John,Mary" />
 Web Forms Syntax Reference
                                                      The HTTP method can be indicated using the Verb attribute:

ASP.NET Web Services
 Introducing Web Services                                   <allow VERB="POST" users="John,Mary" />
 Writing a Simple Web Service                               <deny VERB="POST" users="*" />
 Web Service Type Marshalling                               <allow VERB="GET" users="*" />

 Using Data in Web Services
 Using Objects and Intrinsics                         This example lets Mary and John POST to the protected resources, while
                                                      only allowing everyone else to use GET.
 The WebService Behavior
 HTML Pattern Matching
                                                      There are two special usernames:

ASP.NET Web Applications                                     q   *: All users
 Application Overview                                        q   ?: Anonymous (unauthenticated) users
 Using the Global.asax File
 Managing Application State                           These special usernames are commonly used by applications using forms-
                                                      based authentication to deny access to unauthenticated users, as shown in
 HttpHandlers and Factories
                                                      the following example:

Cache Services
 Caching Overview                                           <authorization>
                                                                <deny users="?" />
 Page Output Caching
                                                            </authorization>
 Page Fragment Caching
 Page Data Caching
                                                      URL authorization is computed hierarchically and the rules used to
                                                      determine access are as follows:
Configuration
 Configuration Overview                                      q   Rules relevant to the URL are collected from across the hiearchy
                                                                 and a merged list of rules is constructed.
 Configuration File Format
                                                             q   The most recent rules are placed at the head of the list. This
 Retrieving Configuration                                        means that configuration in the current directory is at the head of
                                                                 the list, followed by configuration in the immediate parent, and so
                                                                 on, up to the top-level file for the computer.
Deployment                                                   q   Rules are checked until a match is found. If the match is
 Deploying Applications                                          allowable, access is granted. If not, access is disallowed.
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/authorization.aspx (1 of 2) [4/02/2002 8:52:02 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors                                      What this means is that applications that are not interested in inheriting
                                                      their configuration should explicitly configure all of the possiblities relevant
                                                      to their applications.
Security
 Security Overview
                                                      The default top-level Web.config file for a given computer allows access to
 Authentication & Authorization                       all users. Unless an application is configured to the contrary (and assuming
 Windows-based Authentication                         that a user is authenticated and passes the file authorization ACL check),
                                                      access is granted.
 Forms-based Authentication
 Authorizing Users and Roles
                                                      When roles are checked, URL authorization effectively marches down the
 User Account Impersonation                           list of configured roles and does something that looks like the following
 Security and WebServices                             pseudocode:


Localization                                                If User.IsInRole("ConfiguredRole") Then
 Internationalization Overview                                ApplyRule()
 Setting Culture and Encoding                               End If
 Localizing ASP.NET Applications
 Working with Resource Files                          VB


                                                      What this means for your application is that you use your own class that
Tracing
                                                      implements System.Security.Principal.IPrincipal to provide your own
 Tracing Overview                                     role-mapping semantics, as explained in Windows-based Authentication.
 Trace Logging to Page Output
 Application-level Trace Logging                      The following sample uses forms-based authentication services. It explicitly
                                                      denies access to jdoe@somewhere.com and anonymous users. Try logging
                                                      into the sample with Username="jdoe@somewhere.com" and
Debugging                                             Password="password". Access will be denied and you will be redirected
 The SDK Debugger                                     back to the logon page. Now log on as
                                                      Username="mary@somewhere.com" and Password="password". You will
                                                      see that access is granted.
Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
                                                              VB Forms-Based/Cookie Authentication with URL
 Syntax and Semantics
                                                              Authorization
 Language Compatibility
 COM Interoperability                                        [Run Sample] | [View Source]
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/authorization.aspx (2 of 2) [4/02/2002 8:52:02 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      User Account Impersonation
 Introduction
 What is ASP.NET?                                    As mentioned in the Security Overview, impersonation refers to a process
 Language Support                                    in which a COM object executes with the identity of the entity on behalf of
                                                     which it is performing work. What this means for a Web application is that
                                                     if a server is impersonating, it is doing work using the identity of the client
ASP.NET Web Forms                                    making the request.
 Introducing Web Forms
 Working with Server Controls                        By default, ASP.NET does not do per-request impersonation. This is
                                                     different from ASP, which does impersonate on every request. If desired,
 Applying Styles to Controls
                                                     you can configure an application to impersonate on every request with the
 Server Control Form Validation                      following Configuration directive:
 Web Forms User Controls
 Data Binding Server Controls
                                                           <identity impersonate="true" />
 Server-Side Data Access
 Data Access and Customization
                                                     Since ASP.NET does dynamic compilation, enabling impersonation requires
 Working with Business Objects
                                                     that all accounts have read/write access to the application's Codegen
 Authoring Custom Controls                           directory (where dynamically compiled objects are stored by the ASP.NET
 Web Forms Controls Reference                        runtime) as well as the global assembly cache (%Windir%\assembly).
                                                     Some applications require impersonation to be enabled for ASP
 Web Forms Syntax Reference
                                                     compatibility or to use Windows authentication services.


ASP.NET Web Services
 Introducing Web Services
 Writing a Simple Web Service
 Web Service Type Marshalling
 Using Data in Web Services
 Using Objects and Intrinsics
 The WebService Behavior
 HTML Pattern Matching


ASP.NET Web Applications
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/impersonation.aspx (1 of 2) [4/02/2002 8:52:03 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/impersonation.aspx (2 of 2) [4/02/2002 8:52:03 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Security and WebServices
 Introduction
 What is ASP.NET?                                  Windows Authentication and Authorization
 Language Support                                  Custom Authentication and Authorization (with Soap Headers)
                                                   Section Summary
ASP.NET Web Forms
 Introducing Web Forms
 Working with Server Controls
 Applying Styles to Controls              This section describes methods for securing your Web services. If you haven't already read the Security section of
 Server Control Form Validation           this tutorial, take the time to do so now before continuing in this topic.
 Web Forms User Controls
 Data Binding Server Controls             Windows Authentication and Authorization
 Server-Side Data Access
 Data Access and Customization            You use the same technique to secure your Web services using Windows authentication that you used for .aspx
 Working with Business Objects            pages (described in the Windows-based Authentication section). To require authentication, you enable
                                          Integrated Windows authentication for your application and disable Anonymous access in the IIS
 Authoring Custom Controls
                                          management console. To allow or deny specific users access to your service, use the ASP.NET configuration
 Web Forms Controls Reference             system or set ACLs on the service file itself, as shown in the following example:
 Web Forms Syntax Reference
                                               <configuration>
ASP.NET Web Services                              <system.web>
 Introducing Web Services                           <authentication mode="Windows"/>
 Writing a Simple Web Service                     </system.web>
 Web Service Type Marshalling                     <location path="secureservice.asmx">
 Using Data in Web Services
                                                     <system.web>
 Using Objects and Intrinsics
                                                       <authorization>
 The WebService Behavior                                 <allow users="Administrator"/>
 HTML Pattern Matching                                   <allow users="DOMAIN\Bradley"/>
                                                         <deny roles="BUILTIN\Power Users"/>
                                                       </authorization>
ASP.NET Web Applications                             </system.web>
 Application Overview
                                                  </location>
 Using the Global.asax File
 Managing Application State                    </configuration>

 HttpHandlers and Factories
                                          This works well when you know that the client of the Web service will be running as a specific Windows user. A
                                          more interesting case is is that of a client running as one user, but acting on behalf of another. Consider an
Cache Services                            ASP.NET page that accesses a secure Web service that does not impersonate the client who accesses it. In such
 Caching Overview                         a case, you should programmatically set the username and password before connecting to the Web service. The
                                          following example uses basic authentication and illustrates a simple WebService:
 Page Output Caching
 Page Fragment Caching
 Page Data Caching                             <%@ WebService language="VB" Class="SecureService" %>

                                               Imports System.Web.Services
Configuration                                  Imports System
 Configuration Overview
                                               Class SecureService : Inherits WebService
 Configuration File Format
 Retrieving Configuration
                                                   Public Function SecureTest As String
                                                       Return "Hello from the secure web service"
Deployment                                         End
                                               End Class
 Deploying Applications
 Using the Process Model
                                          VB
 Handling Errors

                                          You could require basic authentication for this service by making appropriate settings in IIS as follows:
Security
 Security Overview
                                               1. Open the IIS MMC console.
 Authentication & Authorization
 Windows-based Authentication
                                                         Start->Run "inetmgr"
 Forms-based Authentication
 Authorizing Users and Roles                   2. In the left pane, expand the tree to find your virtual directory.
 User Account Impersonation                    3. In the right pane, right-click Secureservice.asmx, and choose Properties.
 Security and WebServices                      4. Select the File Security tab. Under Anonymous Access and Authentication Control, click Edit.


                                                             Disable anonymous access.
Localization
                                                         r




 http://samples.gotdotnet.com/quickstart/aspplus/doc/secureservices.aspx (1 of 3) [4/02/2002 8:52:05 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Internationalization Overview                           r    Disable integrated Windows authentication.
                                                         r    Enable basic authentication.
 Setting Culture and Encoding
 Localizing ASP.NET Applications
                                               5. Click OK to save these settings and exit the MMC console.
 Working with Resource Files

                                          The base WebService proxy class provides two properties, Username and Password, that you can use to
Tracing                                   specify the credentials with which to connect to the remote Web service. These must be set to valid Windows
 Tracing Overview                         credentials on the Web service's computer or domain.
 Trace Logging to Page Output
 Application-level Trace Logging
                                               <%@ Import Namespace="SecureService" %>

                                               <html>
Debugging                                      <script language="VB" runat="server">
 The SDK Debugger
                                                     Public Sub Page_Load(sender As Object, e As EventArgs)

Performance                                                  Dim s As New SecureService
 Performance Overview
                                                             s.Credentials = New System.Net.NetworkCredential("Administrator", "test123")
 Performance Tuning Tips
 Measuring Performance                                   Message.Text = s.SecureTest()
                                                     End Sub

ASP to ASP.NET Migration                       </script>
 Migration Overview                            <body>
 Syntax and Semantics                            <h4><font face="verdana">
 Language Compatibility                            <asp:Label id="Message" runat="server"/>
                                                 </font></h4>
 COM Interoperability                          </body>
 Transactions
                                               </html>

Sample Applications
                                          VB
 A Personalized Portal
 An E-Commerce Storefront
                                          The base WebService class also provides a User property of type System.Security.Principal.IPrincipal,
 A Class Browser Application              which you can use to retrieve information about the client user. Again, you can authorize access to your Web
 IBuySpy.com                              service using the Authorization section in the ASP.NET configuration system.


Get URL for this page                     Custom Authentication and Authorization with Soap Headers

                                          Windows authentication works well for intranet scenarios, in which you are authenticating against a user in your
                                          own domain. On the Internet, however, you probably want to perform custom authentication and authorization,
                                          perhaps against a SQL database. In that case, you should pass custom credentials (such as the username and
                                          password) to your service and let it handle the authentication and authorization itself.


                                          A convenient way to pass extra information along with a request to a Web service is a SOAP header. To do this,
                                          define a class that derives from SOAPHeader in your service, and then declare a public field of your service as
                                          that type. This is exposed in the public contract for your service, and made available to the client when the proxy
                                          is created from WebServiceUtil.exe, as in the following example:



                                               Imports System.Web.Services
                                               Imports System.Web.Services.Protocols

                                               ' AuthHeader class extends from SoapHeader
                                               Public Class AuthHeader : Inherits SoapHeader
                                                   Public Username As String
                                                   Public Password As String
                                               End Class

                                               Public Class HeaderService : Inherits WebService
                                                   Public sHeader As AuthHeader
                                                   ...
                                               End Class


                                          VB


                                          Each WebMethod in your service can define a set of associated headers using the SoapHeader custom
                                          attribute. By default, the header is required, but it is possible to define optional headers as well. The
                                          SoapHeader attribute specifies the name of a public field or property of the Client or Server class (referred to
                                          as a Headers property in this topic). WebServices sets the value of a Headers property before the method is
                                          called for input headers, and retrieves the value when the method returns for output headers. For more
                                          information about output or optional headers see the .NET Framework SDK documentation.




 http://samples.gotdotnet.com/quickstart/aspplus/doc/secureservices.aspx (2 of 3) [4/02/2002 8:52:05 AM]
Microsoft ASP.NET QuickStarts Tutorial



                                              Public Function         SecureMethod() As String

                                                  If (sHeader Is Nothing)
                                                       Return "ERROR: Please supply credentials"
                                                  Else
                                                       Return "USER: " & sHeader.Username
                                                  End If
                                              End Function


                                         VB


                                         A client then sets the header on the proxy class directly before making a method call that requires it, as shown in
                                         the following example:



                                              Dim h As New HeaderService
                                              Dim myHeader As New AuthHeader
                                              myHeader.Username = "JohnDoe"
                                              myHeader.Password = "password"
                                              h.AuthHeader = myHeader
                                              Dim result As String = h.SecureMethod()


                                         VB


                                         To see this code in action, run the following sample:




                                                 VB SoapHeaders.aspx

                                                [Run Sample] | [View Source]


                                         Section Summary

                                              1. Securing your Web services on the server using Windows authentication follows exactly the same model
                                                 as described for .aspx page.
                                              2. You can also programmatically set Windows credentials using the Username and Password properties
                                                 on the WebService proxy class.
                                              3. Lastly, you can do custom authentication by passing credential information as SOAPHeaders, along
                                                 with a SOAP request to the method that requires it.



                                                                     Copyright 2001 Microsoft Corporation. All rights reserved.




http://samples.gotdotnet.com/quickstart/aspplus/doc/secureservices.aspx (3 of 3) [4/02/2002 8:52:05 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Internationalization Overview
 Introduction
 What is ASP.NET?                                  Encoding Support
 Language Support                                  Localization Support
                                                   Configuration Settings
ASP.NET Web Forms                                  Section Summary
 Introducing Web Forms
 Working with Server Controls
 Applying Styles to Controls              Encoding Support
 Server Control Form Validation
 Web Forms User Controls                  ASP.NET internally uses Unicode. In addition, ASP.NET utilizes the String class of the .NET Framework
 Data Binding Server Controls             class library and the related utility functions, which are also internally Unicode. When interfacing with the
                                          outside world, ASP.NET can be configured in several ways to use a defined encoding, which includes the
 Server-Side Data Access                  encoding of .aspx files, request data, and response data. For example, it is possible to store .aspx files
 Data Access and Customization            with Unicode encoding and convert the HTML output of a page to an ANSI code page like ISO-8859-1.
 Working with Business Objects
                                          Localization Support
 Authoring Custom Controls
 Web Forms Controls Reference
                                          Properties of a locale are accessible through the CultureInfo class. Additionally, ASP.NET tracks two
 Web Forms Syntax Reference               properties of a default culture per thread and request: CurrentCulture for the default of locale-
                                          dependent functions and CurrentUICulture for locale-specific lookup of resource data.
ASP.NET Web Services
 Introducing Web Services                 The following code displays the culture values on the Web server. Note that the CultureInfo class is
                                          fully qualified.
 Writing a Simple Web Service
 Web Service Type Marshalling
                                               <%@Import Namespace="System.Globalization"%>
 Using Data in Web Services                    ...
 Using Objects and Intrinsics                  <%=CultureInfo.CurrentCulture.NativeName%>
 The WebService Behavior                       <%=CultureInfo.CurrentUICulture.NativeName%>

 HTML Pattern Matching
                                          The result is as follows:

ASP.NET Web Applications                       English (United States)
 Application Overview                          English (United States)
 Using the Global.asax File
 Managing Application State               For locale-dependent data like date/time formats or currency, ASP.NET leverages the support of the .NET
 HttpHandlers and Factories               Framework class library in the common language runtime. Code on ASP.NET pages can use locale-
                                          dependent formatting routines like DateTime.Format. For example, the following code displays the
                                          current date in a long format: the first line according to the system locale, the second one according to
Cache Services                            the German ("de") locale:
 Caching Overview
 Page Output Caching                           <%=DateTime.Now.ToString("f")%>
 Page Fragment Caching                         <%=DateTime.Now.ToString("f", new System.Globalization.CultureInfo("de-DE"))%>
 Page Data Caching
                                          The result is as follows:

Configuration                                  Sunday, February 03, 2002 1:51 PM
 Configuration Overview                        Sonntag, 3. Februar 2002 13:51
 Configuration File Format
 Retrieving Configuration                 Configuration Settings

                                          When creating ASP.NET pages or code-behind modules, developers can use the .NET Framework class
Deployment                                library to provide features necessary for a globalized environment or to localize the application. ASP.NET
 Deploying Applications                   also provides configuration settings to ease development and administration of ASP.NET applications.
 Using the Process Model
 Handling Errors                          ASP.NET utilizes configuration files to provide directory settings that are usually also inherited by
                                          subdirectories. Each file can contain a Globalization section in which you can specify default encodings
                                          and cultures. Values are valid if they are accepted by the related classes Encoding and CultureInfo.
Security                                  You can find more information about the Encoding and CultureInfo classes in the .NET Framework
 Security Overview                        SDK.
 Authentication & Authorization
 Windows-based Authentication                  <configuration> <system.web> <globalization fileEncoding="utf-8"
                                               requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US"
 Forms-based Authentication
                                               uiCulture="de-DE" /> </system.web> </configuration>
 Authorizing Users and Roles              Within the Globalization section, the value of fileEncoding determines the way in which ASP.NET
 User Account Impersonation               encodes .aspx files; the values of requestEncoding and responseEncoding determine the way in


 http://samples.gotdotnet.com/quickstart/aspplus/doc/internationalization.aspx (1 of 2) [4/02/2002 8:52:07 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Security and WebServices                 which request data and response data are encoded, respectively.


                                          The attributes of the Globalization section in the Web.config file can also be specified on the Page
Localization
                                          directive (with the exception of fileEncoding, because it applies to the file itself). These settings are
 Internationalization Overview            only valid for a specific page and override the settings of the Web.config file. The following sample
 Setting Culture and Encoding             directive specifies that the page should use French culture settings and UTF-8 encoding for the response:
 Localizing ASP.NET Applications
 Working with Resource Files                   <%@Page Culture="fr-FR" UICulture="fr-FR" ResponseEncoding="utf-8"%>


                                          Note: Within a page, the culture values can be changed programmatically by setting
Tracing
                                          Thread.CurrentCulture and Thread.UICulture.
 Tracing Overview
 Trace Logging to Page Output
                                          Section Summary
 Application-level Trace Logging

                                               1. ASP.NET supports a wide range of encodings for .aspx files, request data, and response data.
Debugging                                      2. Support for locale-dependent data is provided by the CultureInfo class, where the two values
 The SDK Debugger                                 CurrentCulture and CurrentUICulture are tracked.
                                               3. Internationalization settings can be configured for each computer, for each directory, and for
                                                  each page.
Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




 http://samples.gotdotnet.com/quickstart/aspplus/doc/internationalization.aspx (2 of 2) [4/02/2002 8:52:07 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                      Setting Culture and Encoding
 Introduction
 What is ASP.NET?                             Encodings
 Language Support                             Using CultureInfo
                                              Using RegionInfo
ASP.NET Web Forms                             Section Summary
 Introducing Web Forms
 Working with Server Controls
 Applying Styles to Controls         Encodings
 Server Control Form Validation
 Web Forms User Controls             Internally, ASP.NET handles all string data as Unicode. By using the ResponseEncoding attribute in the following
 Data Binding Server Controls        sample, ASP.NET is asked to also send the page with UTF-8 encoding. Note that any arbitrary encoding could be chosen
                                     without affecting the .aspx file. ASP.NET also sets the CharSet attribute on the Content Type of the HTTP header
 Server-Side Data Access
                                     according to the value of ResponseEncoding. This enables browsers to determine the encoding without a metatag or
 Data Access and Customization       having to guess the correct encoding from the content.
 Working with Business Objects
 Authoring Custom Controls
 Web Forms Controls Reference
 Web Forms Syntax Reference


ASP.NET Web Services
 Introducing Web Services                    VB i18n_encodings.aspx
 Writing a Simple Web Service
 Web Service Type Marshalling               [Run Sample] | [View Source]
 Using Data in Web Services
 Using Objects and Intrinsics        Note: If some characters appear as empty rectangles, you must install the additional language support for Japanese
 The WebService Behavior             and Hebrew. To do this on a Windows 2000 platform, open Regional Options on the Control Panel and add the
                                     required language support.
 HTML Pattern Matching

                                     The following sample demonstrates how to use different national character sets on the same page. The page contains
ASP.NET Web Applications             English text (ASCII), German text with one umlaut character, Japanese text, and Hebrew text (uses dir="rtl"). The
 Application Overview                source for the page itself is stored with codepage-neutral UTF-8 encoding, as specified in Web.config.
 Using the Global.asax File
 Managing Application State               <configuration> <system.web> <globalization fileEncoding="utf-8" ... />
                                          </system.web> </configuration>
 HttpHandlers and Factories

                                     The Page directive specifies ResponseEncoding on the page itself:
Cache Services
 Caching Overview
                                          <%@Page ... ResponseEncoding="utf-8"%>
 Page Output Caching
 Page Fragment Caching
                                     Note: The ResponseEncoding in Web.config is also specified as UTF-8, so repeating it on the page is redundant.
 Page Data Caching                   However, if the .aspx file is moved to a server that does not use UTF-8, the file would still specify the right encoding.

                                     Using CultureInfo
Configuration
 Configuration Overview
                                     Code on ASP.NET pages can use the CultureInfo class to supply localized settings. In the following sample, the
 Configuration File Format           properties of a culture, initially the culture of the server, is set as follows:
 Retrieving Configuration

                                          culture = CultureInfo.CurrentCulture
Deployment
 Deploying Applications
                                     VB
 Using the Process Model
 Handling Errors
                                     If the name of a new culture is submitted, it will be used instead:

Security
 Security Overview                        culture = New CultureInfo(NewCulture.Value)
 Authentication & Authorization
 Windows-based Authentication        VB
 Forms-based Authentication
 Authorizing Users and Roles         The submitted culture is set to be the new default value and some properties are displayed:
 User Account Impersonation
 Security and WebServices
                                          <%
                                          Thread.CurrentThread.CurrentCulture = culture
Localization                              %>
                                          ...
 Internationalization Overview
                                          Current Culture is <%= CultureInfo.CurrentCulture.Name %>
 Setting Culture and Encoding             (<%=Thread.CurrentThread.CurrentCulture.Name%>),



 http://samples.gotdotnet.com/quickstart/aspplus/doc/cultureencoding.aspx (1 of 2) [4/02/2002 8:52:09 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Localizing ASP.NET Applications          <%= CultureInfo.CurrentCulture.EnglishName %>/<%=CultureInfo.CurrentCulture.NativeName%>,
                                          The localized date is: <%= DateTime.Now.ToString("D", CultureInfo.CurrentCulture) %>
 Working with Resource Files

                                     VB
Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger
                                            VB i18n_cultureinfo.aspx

Performance                                 [Run Sample] | [View Source]
 Performance Overview
 Performance Tuning Tips
 Measuring Performance
                                     Using RegionInfo

                                     Code on ASP.NET pages can also use the RegionInfo class to supply regional settings. In the following sample, the
ASP to ASP.NET Migration             properties of a region are displayed. The initial display is the server's default region.
 Migration Overview
 Syntax and Semantics
 Language Compatibility                   region = RegionInfo.CurrentRegion
                                          ...
 COM Interoperability
                                          Current region is <%= region.EnglishName %> (<%=region.DisplayName%>),
 Transactions                             currency is <%= region.CurrencySymbol %>.


Sample Applications                  VB
 A Personalized Portal
 An E-Commerce Storefront            On subsequent requests the entered region is displayed:
 A Class Browser Application
 IBuySpy.com
                                          region = New RegionInfo(NewRegion.Value)

Get URL for this page                VB




                                            VB I18N_Regional.aspx

                                            [Run Sample] | [View Source]


                                     Section Summary

                                          1. ASP.NET can use pages that are stored with UTF-8 encoding to support different national characters.
                                          2. The CultureInfo class can be set and used programmatically to localize pages.
                                          3. The RegionInfo class can be used to provide regional settings on ASP.NET pages.




 http://samples.gotdotnet.com/quickstart/aspplus/doc/cultureencoding.aspx (2 of 2) [4/02/2002 8:52:09 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Localizing ASP.NET Applications
 Introduction
 What is ASP.NET?                                 Copy and Translate
 Language Support                                 Localization and Controls
                                                  Section Summary
ASP.NET Web Forms
 Introducing Web Forms
 Working with Server Controls             Copy and Translate
 Applying Styles to Controls
 Server Control Form Validation           The easiest way to localize a Web page is usually to create a copy and translate it to the target
 Web Forms User Controls                  language. This works well for static content that does not require a lot of maintenance. To support this
                                          model for ASP.NET pages, you can set the Culture attribute using the Page directive. All locale-
 Data Binding Server Controls             dependent methods pick up the value of the Culture attribute.
 Server-Side Data Access
 Data Access and Customization            The following sample shows how to do this for three independent, localized versions of a page. The
 Working with Business Objects            Culture property is set on each page to determine the format of the date:
 Authoring Custom Controls
 Web Forms Controls Reference
                                               <%@Page Culture="de-DE" Language="VB" %>
 Web Forms Syntax Reference                    ...
                                               <%=DateTime.Now.ToString("f", Nothing)%>
ASP.NET Web Services
 Introducing Web Services                 VB
 Writing a Simple Web Service
 Web Service Type Marshalling
 Using Data in Web Services
 Using Objects and Intrinsics
 The WebService Behavior
 HTML Pattern Matching
                                                  VB news-en-us.aspx                 VB news-de.aspx                     VB news-ja.aspx
ASP.NET Web Applications
 Application Overview                             [Run Sample] |                     [Run Sample] |                     [Run Sample] |
 Using the Global.asax File                       [View Source]                      [View Source]                      [View Source]
 Managing Application State
 HttpHandlers and Factories
                                          Localization and Controls

Cache Services                            An improvement over the simple copy-and-translate approach is to use controls to pick up the culture of
 Caching Overview                         the main page. In the following sample, the image of the flag and the search bar are controls.
 Page Output Caching                      Depending on the culture of the hosting page, they render different content. To support this, the
                                          UICulture attribute is also added to each page:
 Page Fragment Caching
 Page Data Caching
                                               <%@Page Culture="de-DE" UICulture="de-DE" Language="VB" %>
Configuration
 Configuration Overview                   VB
 Configuration File Format
 Retrieving Configuration                 The flag control (Flag.ascx), for example, just uses the culture name to build the Src attribute of an
                                          <img> tag:

Deployment
 Deploying Applications                        <%@Import Namespace="System.Globalization"%>
 Using the Process Model
                                               <script runat="Server" Language="VB">
 Handling Errors                               Overrides Protected Sub Render(writer As HtmlTextWriter)
                                                   FlagImage.Src = "../../flags/" & CultureInfo.CurrentCulture.Name & ".jpg"
                                                   FlagImage.Alt = CultureInfo.CurrentCulture.NativeName
Security                                           MyBase.Render(writer)
 Security Overview                             End Sub
 Authentication & Authorization                </script>
 Windows-based Authentication                  <img runat="server" id="FlagImage" />
 Forms-based Authentication
 Authorizing Users and Roles              VB



 http://samples.gotdotnet.com/quickstart/aspplus/doc/localizingapps.aspx (1 of 2) [4/02/2002 8:52:11 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 User Account Impersonation
                                          The search control (Search.ascx) uses a switch statement to initialize the values of a label and a text
 Security and WebServices
                                          box, but the culture name could also be the parameter for a database query:

Localization
 Internationalization Overview                 Sub LocalizeSearchText()
                                                 Select Case String.Intern(CultureInfo.CurrentUICulture.Name))
 Setting Culture and Encoding
                                                   Case "en-US"
 Localizing ASP.NET Applications                     SearchText.Text = "Clinton"
 Working with Resource Files                         SearchButton.Text = "Search"

                                                   Case "de-DE"
Tracing                                              ...
                                                   Case "ja-JP"
 Tracing Overview
                                                     ...
 Trace Logging to Page Output                      Case Else
 Application-level Trace Logging                     SearchButton.Text = "Search"
                                                 End Select
                                               End Sub
Debugging
 The SDK Debugger                         VB


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration                          VB news-en-us.aspx                  VB news-de.aspx                    VB news-ja.aspx
 Migration Overview
 Syntax and Semantics                             [Run Sample] |                     [Run Sample] |                     [Run Sample] |
 Language Compatibility                           [View Source]                      [View Source]                      [View Source]
 COM Interoperability
 Transactions
                                          Section Summary

Sample Applications
                                               1. ASP.NET pages support Culture and UICulture attributes to support independent localized
 A Personalized Portal                            pages.
 An E-Commerce Storefront                      2. Controls on pages can pick the culture of the page and can render culture-dependent content.
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




 http://samples.gotdotnet.com/quickstart/aspplus/doc/localizingapps.aspx (2 of 2) [4/02/2002 8:52:11 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                    Working with Resource Files
 Introduction
 What is ASP.NET?                          Creating Resources
 Language Support                          Using Resources on a Page
                                           Using Satellite Assemblies
ASP.NET Web Forms                          Using Satellite Assemblies for Controls
 Introducing Web Forms                     Section Summary
 Working with Server Controls
 Applying Styles to Controls
 Server Control Form Validation    Creating Resources
 Web Forms User Controls
 Data Binding Server Controls      Resource management, a feature of the .NET Framework class library, can be used to extract localizable elements from source code
 Server-Side Data Access           and to store them with a string key as resources. At runtime an instance of the ResourceManager class can be used to resolve the
                                   key to the original resource or a localized version. Resources can be stored as independent ("loose") files or as a part of an assembly.
 Data Access and Customization
 Working with Business Objects
                                   ASP.NET pages can utilize resource files; compiled code-behind controls can, in addition, utilize resources embedded or linked into
 Authoring Custom Controls         their assembly.
 Web Forms Controls Reference
 Web Forms Syntax Reference        Resources can be created using the ResourceWriter class programmatically or by the tool Resgen.exe. Resgen.exe can use a simple
                                   key=value format as input or an XML file in .resx format.

ASP.NET Web Services
                                          ; ; Lines beginning with a semicolon can be used for comments. ; [strings] greeting=Welcome !
 Introducing Web Services
                                          more=Read more ... ...
 Writing a Simple Web Service      ResourceWriter and Resgen.exe create a .resources file, which can be used as is or as part of an assembly. To include a .resources
 Web Service Type Marshalling      file in an assembly, use the related compiler switch or the Al.exe tool. Assemblies containing only localized resources and no code are
 Using Data in Web Services        called satellite assemblies.
 Using Objects and Intrinsics      Using Resources on a Page
 The WebService Behavior
 HTML Pattern Matching             The following sample implements only one .aspx page, which is localized for each request. The supported languages are English,
                                   German, and Japanese. The language is determined by examining the Content-Language field of the HTTP header in the
                                   Global.asax file. The contents of the field are accessible through the UserLanguages collection:
ASP.NET Web Applications
 Application Overview
 Using the Global.asax File               Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages(0))
 Managing Application State
 HttpHandlers and Factories        VB


Cache Services                     To change the initial language setting, you can use differently localized clients or change the language setting on your browser. For
 Caching Overview                  Internet Explorer 5.x, for example, select Tools -> Internet Options from the menu and click the Languages button at the
                                   bottom. In the following dialog you can add additional languages and define their priority. For simplicity the sample always chooses
 Page Output Caching               the first entry.
 Page Fragment Caching
 Page Data Caching                 After the page is loaded the first time, the user can select another culture in the drop-down list control MyUICulture. If a valid
                                   culture is selected, this value overrides the setting acquired from UserLanguages:

Configuration
 Configuration Overview
                                          Dim SelectedCulture As String = MyUICulture.SelectedItem.Text
 Configuration File Format                If Not(SelectedCulture.StartsWith("Choose")) Then
 Retrieving Configuration                   ' If another culture was selected, use that instead.
                                            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages(0))
                                            Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture
Deployment                                End If
 Deploying Applications
 Using the Process Model           VB
 Handling Errors
                                   In the previous code, the use of the CreateSpecificCulture method is required because you cannot set the current CultureInfo of your
                                   Thread to a neutral culture. However, the string available from the UserLanguages setting may be a neutral culture. Therefore, the
Security                           CreateSpecificCulture method takes this string, and makes an appropriate CultureInfo from it.
 Security Overview
 Authentication & Authorization    Also, in the Global.asax file, a ResourceManager instance with application scope is initialized. This way, resources are only loaded
 Windows-based Authentication      once per application. Because resources are read-only, no lock contention should occur.
 Forms-based Authentication
 Authorizing Users and Roles
                                          Public Sub Application_Start()
 User Account Impersonation                   Application("RM") = New ResourceManager("articles", _
 Security and WebServices                                 Server.MapPath("resources") + Environment.DirectorySeparatorChar, _
                                                          Nothing)
                                          End Sub
Localization
 Internationalization Overview
                                   VB
 Setting Culture and Encoding
 Localizing ASP.NET Applications   The resource manager then can easily be used on the page. The greeting string is simply localized by:
 Working with Resource Files
                                          <%=rm.GetString("greeting")%>
Tracing
 Tracing Overview



 http://samples.gotdotnet.com/quickstart/aspplus/doc/resourcefiles.aspx (1 of 3) [4/02/2002 8:52:13 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger
                                            global.asax                       VB news.aspx
Performance
 Performance Overview                       [View Source]                     [Run Sample] | [View Source]
 Performance Tuning Tips
 Measuring Performance
                                   Using Satellite Assemblies

ASP to ASP.NET Migration           If you look at the structure of the directories in the sample in the previous section, you see that the resources for the sample are
 Migration Overview                loaded not from DLLs, but from .resource files. Although this is certainly one solution, you can also compile your code into satellite
 Syntax and Semantics              assemblies. A satellite assembly is defined as an assembly with resources only, no executable code. For more information on satellite
 Language Compatibility            assemblies, see the section How Do I... Create Resources? .

 COM Interoperability
 Transactions                      The benefit of using satellite assemblies becomes apparent when you realize that .resources files are not shadow-copied because they
                                   are not DLLs, and therefore Web sites can encounter locking problems when using them. The alternative is to use a parallel main
                                   assembly for application resources. The main assembly contains fallback resources; the satellites (one per culture) contain localized
Sample Applications                resources. The main assembly is installed into the \bin directory, and the satellites are stored in the usual xx-XX subdirectories (see
                                   How Do I... Create Resources? ). Being assemblies, they are shadow-copied and are not locked. To create an assembly-aware .asp
 A Personalized Portal
                                   application:
 An E-Commerce Storefront
 A Class Browser Application
                                          1. Create the resource DLL and copy it into the \bin directory. For example:
 IBuySpy.com

                                             resgen qq.txt qq.resources
Get URL for this page                        al /embed:qq.resources, qq.resources, y /out:qq.dll


                                             The "y" refers to whether the blob should be visible to other assemblies. Since the ResourceManager lives in Mscorlib and
                                             is a different assembly from "qq", the .resources file must be publically visible. The "y" says whether this should be public.


                                          2. On your page, include the following statement. Note that the name of the assembly here is in the System.Reflection
                                             namespace defined in Mscorlib (which is always referenced for you when compiling):



                                                              &LT;%
                                                              Dim a As Assembly = Assembly.Load("qq")
                                                              Dim rm As ResourceManager = New ResourceManager("qq", a)
                                                              Response.Write(rm.GetString("key"))
                                                              %>


                                             VB


                                          3. Compile each satellite resource into its own assembly, placing it into the correct required directory structure within the /bin
                                             directory:


                                             al /embed:qq.en-us.resources,qq.en-us.resources, y /out:qq.resources.dll /c:en-US


                                             Substitute the code for the culture into which you are localizing for en-US. Remember that the /c: tag is the culture
                                             specifier.


                                   After the DLLs are in the right locations (/bin and /bin/en-US in the above samples), the resources can be retrieved appropriately.
                                   Note that everything gets shadow-copied by assembly cache and thus is replaceable, avoiding potential locking scenarios.




                                   Using Satellite Assemblies for Controls

                                   Compiled code-behind controls can also use satellite assemblies to supply localized content. From a deployment perspective, this is an
                                   especially good thing, because satellite assemblies can be version-independent from the code. As a result, support for additional
                                   languages can be provided just by copying the module of the satellite to the server, and no code change is required.


                                   The following sample contains the LocalizedButton control in the assembly LocalizedControls (module LocalizedControls.dll). On
                                   the page Showcontrols.aspx, the compiled control is registered and used later on:


                                          <%@Register TagPrefix="Loc" namespace="LocalizedControls" %>
                                          ...
                                          <Loc:LocalizedButton runat="server" Text="ok" />


                                   The LocalizedButton control stores a ResourceManager instance, which is shared by all instances of LocalizedButton.
                                   Whenever a control is rendered, the value of the Text property is replaced with the localized version:



                                          _rm = New ResourceManager("LocalizedStrings", _
                                                                    Assembly.GetExecutingAssembly(), _
                                                                    Nothing, _



 http://samples.gotdotnet.com/quickstart/aspplus/doc/resourcefiles.aspx (2 of 3) [4/02/2002 8:52:13 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                                                   True )
                                         ...
                                         Overrides Protected Sub Render (writer As HtmlTextWriter)
                                             Text = ResourceFactory.RManager.GetString(Text)
                                             base.Render(writer)
                                         End Sub


                                 VB


                                 The ResourceManager instance is responsible for resolving the key to a localized resource. If a satellite assembly with the correct
                                 culture is not available and no related culture is found, the neutral resource of the main assembly is used ("en-us" -> "en" ->
                                 neutral). Support for another language is simply granted by copying the module file for the new satellite assembly in place.




                                           Localized Controls                VB Using Localized Controls

                                           [View Source]                    [Run Sample] | [View Source]


                                 Section Summary

                                         1. ASP.NET pages can utilize the resource classes to isolate localizable content in resources, which are selected at runtime.
                                         2. A good alternative is to use satellite assemblies rather than the intermediate .resources files for loading your resources, since
                                            this can avoid locking issues.
                                         3. Compiled controls can contain resources of their own and will select the correct localized content, depending on the
                                            UICulture of the hosting page.




http://samples.gotdotnet.com/quickstart/aspplus/doc/resourcefiles.aspx (3 of 3) [4/02/2002 8:52:13 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Tracing Overview
 Introduction
 What is ASP.NET?                                    When you are developing an application, it is often helpful to be able to
                                                     insert debugging print statements into your code to output variables or
 Language Support
                                                     structures, assert whether a condition is met, or just generally trace
                                                     through the execution path of the application. ASP.NET provides two levels
ASP.NET Web Forms                                    of tracing services that make it easy to do just that.
 Introducing Web Forms
 Working with Server Controls                               q   Page-level Tracing: At the page level, developers can use the
                                                                TraceContext instrinsic to write custom debugging statements
 Applying Styles to Controls                                    that appear at the end of the client output delivered to the
 Server Control Form Validation                                 requesting browser. ASP.NET also inserts some helpful statements
 Web Forms User Controls                                        regarding the start/end of lifecycle methods, like Init, Render,
                                                                and PreRender, in addition to the inputs and outputs to a page,
 Data Binding Server Controls                                   such as form and QueryString variables or headers, and
 Server-Side Data Access                                        important statistics about the page's execution (control hierarchy,
 Data Access and Customization                                  session state, and application state). Because tracing can be
                                                                explicitly enabled or disabled for a page, these statements can be
 Working with Business Objects                                  left in the production code for a page with no impact to the page's
 Authoring Custom Controls                                      performance. Each statement can be associated with a user-
 Web Forms Controls Reference                                   defined category for organizational purposes, and timing
                                                                information is automatically collected by the ASP.NET runtime.
 Web Forms Syntax Reference                                     The resulting output can be ordered by either time or category.


ASP.NET Web Services                                        q   Application-level Tracing": Application-level tracing provides a
 Introducing Web Services                                       view of several requests to an application's pages at once. Like
                                                                page-level tracing, it also displays inputs and outputs to a page,
 Writing a Simple Web Service                                   such as form and QueryString variables or headers, as well as
 Web Service Type Marshalling                                   some important statistics (control hierarchy, session state, and
 Using Data in Web Services                                     application state). Application-level tracing is enabled through the
                                                                ASP.NET configuration system, and accessed as a special mapped
 Using Objects and Intrinsics
                                                                URL into that application (Trace.axd). When application tracing is
 The WebService Behavior                                        enabled, page-level tracing is automatically enabled for all pages
 HTML Pattern Matching                                          in that application (provided there is no page-level directive to
                                                                explicitly disable trace).

ASP.NET Web Applications
                                                     To learn more about how the Trace feature works, read the following two
 Application Overview                                sections: Trace Logging to Page Output and Application-level Trace
 Using the Global.asax File                          Logging.
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/tracingoverview.aspx (1 of 2) [4/02/2002 8:52:15 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/tracingoverview.aspx (2 of 2) [4/02/2002 8:52:15 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Trace Logging to Page Output
 Introduction
 What is ASP.NET?                         Page-level tracing enables you to write debugging statements directly to a page's output, and conditionally run
                                          debugging code when tracing is enabled. To enable tracing for a page, include the following directive at the top
 Language Support
                                          of the page code:

ASP.NET Web Forms                              <%@ Page Trace="true"%>
 Introducing Web Forms
 Working with Server Controls             Trace statements can also be organized by category, using the TraceMode attribute of the Page directive. If no
 Applying Styles to Controls              TraceMode attribute is defined, the default value is SortByTime.
 Server Control Form Validation
 Web Forms User Controls                       <%@ Page Trace="true" TraceMode="SortByCategory" %>
 Data Binding Server Controls
 Server-Side Data Access                  The following example shows the default output when page-level tracing is enabled. Note that ASP.NET inserts
                                          timing information for important places in the page's execution lifecycle:
 Data Access and Customization
 Working with Business Objects
 Authoring Custom Controls
 Web Forms Controls Reference
 Web Forms Syntax Reference


ASP.NET Web Services
                                                 VB Trace1.aspx
 Introducing Web Services
 Writing a Simple Web Service
                                                 [Run Sample] | [View Source]
 Web Service Type Marshalling
 Using Data in Web Services
                                          The page exposes a Trace property (of type TraceContext), which can be used to output debugging
 Using Objects and Intrinsics
                                          statements to the page output, provided tracing is enabled. Using TraceContext, you can write debugging
 The WebService Behavior                  statements using the Trace.Write and Trace.Warn methods, which each take a message string or a category
 HTML Pattern Matching                    and message string. Trace.Warn statements are identical to Trace.Write statements, except they are output in
                                          red.

ASP.NET Web Applications
 Application Overview                          ' Trace(Message)
 Using the Global.asax File                    Trace.Write("Begging User Code...")
                                               ...
 Managing Application State                    Trace.Warn("Array count is Nothing!")
 HttpHandlers and Factories                    ' Trace(Category, Message)
                                               Trace.Write("Custom Trace","Beginning User Code...")
                                               ...
Cache Services                                 Trace.Warn("Custom Trace","Array count is null!")
 Caching Overview
 Page Output Caching                      VB
 Page Fragment Caching
 Page Data Caching                        When tracing is disabled (that is, when Trace="false" on the Page directive, or is not present), these
                                          statements do not run and no Trace output appears in the client browser. This makes it possible to keep
                                          debugging statements in production code and enable them conditionally at a later time.
Configuration
 Configuration Overview
                                          Often you might need to run additional code to construct the statements to pass to the Trace.Write or
 Configuration File Format                Trace.Warn methods, where this code should only run if tracing is enabled for the page. To support this, Page
 Retrieving Configuration                 exposes a Boolean property, Trace.IsEnabled, which returns true only if tracing is enabled for the page. You
                                          should check this property first to guarantee that your debugging code can only run when tracing is on.

Deployment
 Deploying Applications                        If Trace.IsEnabled Then
 Using the Process Model                           For i=0 To ds.Tables("Categories").Rows.Count-1
                                                        Trace.Write("ProductCategory",ds.Tables("Categories").Rows(i)(0).ToString())
 Handling Errors
                                                   Next
                                               End if
Security
 Security Overview                        VB
 Authentication & Authorization
 Windows-based Authentication             The following example shows the use of Trace.Write and Trace.Warn to output debugging statements. Also
 Forms-based Authentication               note the use of the Trace.IsEnabled property to conditionally run extra debugging code. In this example, the
                                          trace information has been sorted by category.
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization

 http://samples.gotdotnet.com/quickstart/aspplus/doc/tracelogpage.aspx (1 of 2) [4/02/2002 8:52:17 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing                                          VB Trace2.aspx
 Tracing Overview
 Trace Logging to Page Output                    [Run Sample] | [View Source]
 Application-level Trace Logging
                                          ASP.NET also provides a way to enable tracing for the entire application, not just a single page. For more about
                                          application-level tracing, click here.
Debugging
 The SDK Debugger
                                          Section Summary
Performance
 Performance Overview                          1. Page-level tracing is enabled using a Trace="true" attribute on the top-level Page directive.
                                               2. Page-level tracing enables you to write debugging statements as part of a page's client output. Trace
 Performance Tuning Tips                          statements are output using the Trace.Write and Trace.Warn methods, passing a category and
 Measuring Performance                            message for each statement.
                                               3. Debugging code can be conditionally run, depending on whether tracing is enabled for the page. Use the
                                                  Trace.IsEnabled property of the page to determine whether tracing is enabled.
ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


Get URL for this page




 http://samples.gotdotnet.com/quickstart/aspplus/doc/tracelogpage.aspx (2 of 2) [4/02/2002 8:52:17 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Application-level Trace Logging
 Introduction
 What is ASP.NET?                         In addition to the Page-level Trace funtionality, ASP.NET provides a way to enable trace output for
                                          an entire application. Enabling Trace at the application level has the effect of enabling Page-level
 Language Support
                                          Trace for every page within that application (provided there is no page-level directive to explicitly
                                          disable trace). When application-level tracing is enabled, the ASP.NET runtime also collects several
ASP.NET Web Forms                         additional statistics, such as the state of the control hierarchy, the contents of session and
                                          application state, the form and querystring input values, and other characteristics of request's
 Introducing Web Forms                    execution. These statistics are collected for a specified number of requests as determined by the
 Working with Server Controls             application's configuration file. To enable tracing for an application, place the following in the
 Applying Styles to Controls              application's web.config file at the application root directory:
 Server Control Form Validation
                                               <configuration>
 Web Forms User Controls
                                                 <system.web>
 Data Binding Server Controls                      <trace enabled="true"/>
 Server-Side Data Access                         </system.web>
                                               </configuration>
 Data Access and Customization
 Working with Business Objects
                                          Using the above configuration, each page in the application will run its page-level trace statements
 Authoring Custom Controls
                                          to be output in the client browser. To access the additional page statistics, request a specially-
 Web Forms Controls Reference             mapped "trace.axd" URL from the application root. For example, if the URL to your application is
 Web Forms Syntax Reference               http://localhost/myapplication, you would request the URL http://localhost/myapplication/trace.axd
                                          to access the trace statistics for that application.

ASP.NET Web Services
 Introducing Web Services
 Writing a Simple Web Service
 Web Service Type Marshalling
 Using Data in Web Services
 Using Objects and Intrinsics
 The WebService Behavior
 HTML Pattern Matching


ASP.NET Web Applications
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview                         By default, trace information will be collected for up to 10 requests (you can use the "clear current
 Page Output Caching                      trace" link to reset the request counter). The trace section of the configuration file also supports an
                                          attribute for controlling whether trace statements are output to the client browser, or whether they
 Page Fragment Caching                    are only available from trace.axd. The attributes supported in the trace configuration section are
 Page Data Caching                        listed in the table below:


Configuration                                    Value                                Description
 Configuration Overview
                                                 enabled                              Set to true | false, indicates whether
 Configuration File Format                                                            Tracing is enabled for the application
 Retrieving Configuration                                                             (default is true)

                                                 pageOutput                           Indicates whether trace information
                                                                                      should be rendered at the end of each
Deployment
                                                                                      page - or only accessible via the
 Deploying Applications                                                               trace.axd utility
 Using the Process Model
                                                 requestLimit                         Number of trace requests to store on
 Handling Errors                                                                      the server (default is 10)

                                                 traceMode                            Set to SortByTime | SortByCategory,
Security                                                                              indicates the display order for Trace
 Security Overview                                                                    messages (default is SortByTime)
 Authentication & Authorization
 Windows-based Authentication



 http://samples.gotdotnet.com/quickstart/aspplus/doc/tracelogapp.aspx (1 of 4) [4/02/2002 8:52:21 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Forms-based Authentication                     localOnly                            Set to true | false, indicates whether
 Authorizing Users and Roles                                                         Tracing is enabled for localhost users or
 User Account Impersonation                                                          for all users (default is true)

 Security and WebServices
                                          For example, the following configuration collects trace information for up to 40 requests, and
                                          prevents trace statements from being output to the requesting browser (provided there is no page-
Localization                              level directive to explicitly enable trace). The messages are displayed in order of category:
 Internationalization Overview
 Setting Culture and Encoding                  <configuration>
 Localizing ASP.NET Applications                 <system.web>
 Working with Resource Files                       <trace
                                                      enabled="true"
                                                      traceMode="SortByCategory"
Tracing                                               requestLimit="40"
                                                      pageOutput="false"
 Tracing Overview
                                                      localOnly="true"
 Trace Logging to Page Output                      />
 Application-level Trace Logging                 </system.web>
                                               </configuration>

Debugging
                                          Application Trace Request Details
 The SDK Debugger

                                          After making a series of requests to the application, accessing trace.axd will list those requests in
Performance                               time-order. You can drill-down into the details for each request by selecting the "View Details" link.
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




                                          The trace application presents the following detailed information for each request:


                                                Request Detail
                                                Value                                Description

                                                Session Id                           The Session Id for this request

                                                Time of Request                      The time the request was made

                                                Status Code                          The returned status code for this
                                                                                     request

                                                Request Type                         GET | POST

                                                Request Encoding                     Encoding for the request

                                                Response Encoding                    Encoding for the response



 http://samples.gotdotnet.com/quickstart/aspplus/doc/tracelogapp.aspx (2 of 4) [4/02/2002 8:52:21 AM]
Microsoft ASP.NET QuickStarts Tutorial



                                               Trace Information
                                               Value                              Description

                                               Category                           The category for a Trace statement
                                                                                  written to the TraceContext

                                               Message                            The message string for this Trace
                                                                                  statement

                                               From First (s)                     Time in seconds from the first Trace
                                                                                  statement
                                               From Last (s)                      Time in seconds from the previous Trace
                                                                                  statement



                                               Control Hierarchy
                                               Value                              Description

                                               Control ID                         The ID for the control

                                               Type                               The fully qualified type of the control

                                               Render Size                        The size of the control's rendering in
                                                                                  bytes including children

                                               ViewState Size                     The size of the control's viewstate in
                                                                                  bytes excluding children



                                               Session State
                                               Value                               Description

                                               Key                                 The key for an object in Session State

                                               Type                                The fully qualified type of the object

                                               Value                               The value of the object



                                               Application State
                                               Value                              Description

                                               Key                                The key for an object in Application
                                                                                  State

                                               Type                               The fully qualified type of the object

                                               Value                              The value of the object



                                               Cookies Collection
                                               Value                              Description

                                               Name                               The name of the cookie

                                               Value                              The value of the cookie, or sub-
                                                                                  keys/values if multi-valued

                                               Size                               The size of the cookie rendering in Bytes



                                               Headers Collection
                                               Value                                        Description

                                               Name                                         The name of the header

                                               Value                                        The value of the header




http://samples.gotdotnet.com/quickstart/aspplus/doc/tracelogapp.aspx (3 of 4) [4/02/2002 8:52:21 AM]
Microsoft ASP.NET QuickStarts Tutorial


                                               Form Collection
                                               Value                                      Description

                                               Name                                       The name of the form variable

                                               Value                                      The value of the form variable



                                               QueryString Collection
                                               Value                                  Description

                                               Name                                   The name of the querystring variable

                                               Value                                  The value of the querystring variable



                                               Server Variables
                                               Value                                    Description

                                               Name                                     The name for the server variable

                                               Value                                    TThe value of the server variable


                                         Section Summary

                                              1. Application-level Tracing is enabled using a "trace" section in the configuration file at the
                                                 application root directory.
                                              2. Application-level Tracing enables trace log output for every page within an application
                                                 (provided there is no page-level directive to explicitly disable trace).
                                              3. After making a series of requests, details for those requests may be accessed by
                                                 requesting "trace.axd" from the application root.




http://samples.gotdotnet.com/quickstart/aspplus/doc/tracelogapp.aspx (4 of 4) [4/02/2002 8:52:21 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                    The Microsoft .NET Framework SDK Debugger
 Introduction
 What is ASP.NET?                  No matter how skilled a programmer you are, you are bound to make mistakes once in a while. Tracking down problems in your
                                   code can be baffling without the appropriate tool. Fortunately, the compiled nature of ASP.NET means that debugging Web
 Language Support
                                   applications is no different than debugging any other managed applications, and the .NET Framework SDK includes a lightweight
                                   debugger that is perfectly suited for this task.
ASP.NET Web Forms
 Introducing Web Forms             This section describes the steps required to debug ASP.NET applications using the debugger provided in this SDK. The debugger
 Working with Server Controls      supports manual-attach debugging of processes on a local development computer. The debugger documentation included in this
                                   SDK is your best resource for information about specific features.
 Applying Styles to Controls
 Server Control Form Validation
                                   Enabling Debug Mode for ASP.NET Applications
 Web Forms User Controls
 Data Binding Server Controls
                                   Because many parts of an ASP.NET application are dynamically compiled at runtime (.aspx and .asmx files, for example), you
 Server-Side Data Access           must configure the ASP.NET runtime to compile the application with symbolic information before the application can be
 Data Access and Customization     debugged. Symbols (.pdb files) tell the debugger how to find the original source files for a binary, and how to map breakpoints
 Working with Business Objects     in code to lines in those source files. To configure an application to compile with symbols, include a debug attribute on the
                                   compilation section within the system.web group of the Web.config file at the application's root directory, as follows:
 Authoring Custom Controls
 Web Forms Controls Reference
                                          <configuration>
 Web Forms Syntax Reference                 <compilation debug="true"/>
                                          </configuration>

ASP.NET Web Services
 Introducing Web Services          Important: You should only enable this setting when you are debugging an application, because it can significantly affect
                                   application performance.
 Writing a Simple Web Service
 Web Service Type Marshalling
                                   Debugging ASP.NET Applications
 Using Data in Web Services
 Using Objects and Intrinsics
                                   When you have enabled debugging for the application, you should issue a request to the page you want to debug. This ensures
 The WebService Behavior           that the ASP.NET runtime process (Aspnet_wp.exe) is created and the application is loaded into memory.
 HTML Pattern Matching
                                   To begin debugging:
ASP.NET Web Applications
 Application Overview                     1.   Launch the .NET Framework debugger, DbgClr.exe.
 Using the Global.asax File               2.   Use the File...Miscellaneous Files...Open File menu to open the source file for the page you want to debug.
                                          3.   From the Tools menu, choose Debug Processes. The screen in the figure following these instructions will appear.
 Managing Application State               4.   Check the Show system processes checkbox, if it is not checked.
 HttpHandlers and Factories               5.   Find the Aspnet_wp.exe process and double-click it to bring up the Attach to Process dialog.
                                          6.   Make sure your application appears in the list of running applications, and select OK to attach.
                                          7.   Close the Programs dialog.
Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model
 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
                                   Important: When you attach to the Aspnet_wp.exe process, all threads in that process are frozen. Under no circumstances
 Forms-based Authentication        should you attempt to debug a live production application, because client requests can not execute normally until the debugger
 Authorizing Users and Roles       is detached.
 User Account Impersonation
 Security and WebServices          Setting Breakpoints

Localization                       To set a breakpoint in your page, click the left-hand margin on a line containing an executable statement or function/method
                                   signature. A red dot appears where the breakpoint is set. Move the mouse over the breakpoint to ensure that it is appropriately
 Internationalization Overview
                                   mapped to the correct application instance in the Aspnet_wp.exe process.
 Setting Culture and Encoding
 Localizing ASP.NET Applications   Reissue the request to the page from your browser. The debugger will stop at the breakpoint and gain the current window
 Working with Resource Files       focus. From this point, you can step, set variable watches, view locals, stack information, disassembly, and so on. You can see
                                   the intrinsic objects on the page, like Request, Response, and Session by using this (C#) or Me (VB) in the watch window.




 http://samples.gotdotnet.com/quickstart/aspplus/doc/debugcomsdk.aspx (1 of 2) [4/02/2002 8:52:23 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com

                                   Generating Symbols for Pre-Compiled Components
Get URL for this page
                                   To debug pre-compiled components, such as business objects or code-behind files, you must compile with symbolic information
                                   prior to debugging. Symbols for assemblies are typically found by means of a path-based search algorithm. The algorithm used
                                   by the PDB library (Mspdb70.dll) to find symbolic information is as follows:


                                          1. Search the same path as the assembly. This is the normal location for .pdb files.
                                             For local assemblies, place the symbols (.pdb files) in the application's /bin directory with the DLLs.
                                          2. Search path as specified in the PE file (the NB10 debug header).
                                          3. Search NT symbol file locations (environment variables _NT_SYMBOL_PATH and _NT_ALT_SYMBOL_PATH).


                                   Note: If symbolic information cannot be found, the debugger prompts for a user-specified location.


                                   Section Summary

                                          1. The debugger described in this section supports manual-attach debugging of processes on a local development
                                             computer.
                                          2. Debugging allows the ASP.NET runtime to dynamically compile with symbolic information. Enable this by setting
                                             <compilation debug="true"/> in the Web.config file located in the application's root directory. The debugger setting
                                             should only be enabled when you are debugging an application, because it degrades application performance.
                                          3. To debug an application, issue a request to a page, attach the debugger to the Aspnet_wp.exe process, set
                                             breakpoints, and reissue the page request.
                                          4. When attached to the Aspnet_wp.exe process, all threads in that process are frozen. Under no circumstances should
                                             you debug a live production application, since client requests can not execute normally until the debugger is detached.
                                          5. To debug pre-compiled components, such as business objects or code-behind files, you must compile with symbolic
                                             information prior to debugging.




 http://samples.gotdotnet.com/quickstart/aspplus/doc/debugcomsdk.aspx (2 of 2) [4/02/2002 8:52:23 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Performance Overview
 Introduction
 What is ASP.NET?                                    Feature-rich web applications are not very useful if they cannot perform
                                                     well. The demands of the Web are so great that code is expected to do
 Language Support
                                                     more in less time than ever before. This section describes some key
                                                     principles of Web application performance, tips for writing code that
ASP.NET Web Forms                                    performs well, and tools for measuring performance.
 Introducing Web Forms
 Working with Server Controls                        ASP.NET provides a number of built-in performance enhancements. For
                                                     example, pages are compiled only once and cached for subsequent
 Applying Styles to Controls                         requests. Because these compiled pages are saved to disk, even a
 Server Control Form Validation                      complete server restart does not invalidate them. ASP.NET also caches
 Web Forms User Controls                             internal objects, such as server variables, to speed user code access.
                                                     Further, ASP.NET benefits from all of the performance enhancements to
 Data Binding Server Controls                        the common language runtime: just-in-time compiling, a fine-tuned
 Server-Side Data Access                             common language runtime for both single- and multiprocessor computers,
 Data Access and Customization                       and so on.

 Working with Business Objects
                                                     However, all of these enhancements cannot protect you from writing code
 Authoring Custom Controls
                                                     that does not perform well. Ultimately, you must ensure that your
 Web Forms Controls Reference                        application can meet the demands of its users. The next section describes a
 Web Forms Syntax Reference                          few of the common ways to avoid performance bottlenecks. However, first
                                                     you need to understand the following metrics:

ASP.NET Web Services                                        q   Throughput: The number of requests a Web application can
 Introducing Web Services                                       serve per unit of time, often measured in requests/second.
 Writing a Simple Web Service                                   Throughput can vary, depending on the load (number of client
 Web Service Type Marshalling                                   threads) applied to the server. This is usually considered the most
                                                                important performance metric to optimize.
 Using Data in Web Services
 Using Objects and Intrinsics
                                                            q   Response Time: The length of time between the issuance of a
 The WebService Behavior                                        request and the first byte returned to the client from the server.
 HTML Pattern Matching                                          This is often the most perceptable aspect of performance to the
                                                                client user. If an application takes a long time to respond, the user
                                                                can become impatient and go to another site. The response time
ASP.NET Web Applications                                        of an application can vary independently of (even inversely to) the
 Application Overview                                           rate of throughput.
 Using the Global.asax File
 Managing Application State                                 q   Execution Time: The time it takes to process a request, usually
                                                                measured between the first byte and the last byte returned to the
 HttpHandlers and Factories                                     client from the server. Execution time directly affects the
                                                                throughput calculation.
Cache Services
 Caching Overview                                           q   Scalability: The measurement of an application's ability to
                                                                perform better as more resources (memory, processors, or
 Page Output Caching
                                                                computers) are allocated to it. Often, it is a measurement of the
 Page Fragment Caching                                          rate of change of throughput with respect to the number of
 Page Data Caching                                              processors.


                                                     Writing applications that perform well is all about striking a balance
Configuration                                        between these metrics. No single measurement can characterize how your
 Configuration Overview                              application will behave under varying circumstances, but several
 Configuration File Format                           measurements taken together can paint a reasonable picture of an
                                                     application's performance.
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/perfoverview.aspx (1 of 2) [4/02/2002 8:52:25 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/perfoverview.aspx (2 of 2) [4/02/2002 8:52:25 AM]
Microsoft ASP.NET QuickStarts Tutorial

    Getting Started                              Performance Tuning Tips
      Introduction
      What is ASP.NET?                           Any programming model has its common performance pitfalls, and ASP.NET is no exception. This section describes some of the ways in which
                                                 you can avoid performance bottlenecks in your code.
      Language Support

                                                      1. Disable Session State when not in use: Not all applications or pages require per-user session state. If it is not required, disable it
    ASP.NET Web Forms                                    completely. This is easily accomplished using a page-level directive, such as the following:
      Introducing Web Forms
      Working with Server Controls                             <%@ Page EnableSessionState="false" %>
      Applying Styles to Controls
      Server Control Form Validation                      Note: If a page requires access to session variables but does not create or modify them, set the value of the directive to ReadOnly.
      Web Forms User Controls                             Session State can also be disabled for Web Service methods. See Using Objects and Intrinsics in the Web Services section.
      Data Binding Server Controls
      Server-Side Data Access                         2. Choose your Session State provider carefully: ASP.NET provides three distinct ways to store session data for your application: in-
                                                         process session state, out-of-process session state as a Windows Service, and out-of-process session state in a SQL database. Each has
      Data Access and Customization
                                                         its advantages, but in-process session state is by far the fastest solution. If you are only storing small amounts of volatile data in
      Working with Business Objects                      session state you should use the in-process provider. The out-of-process solutions are primarily useful in Web garden and Web farm
      Authoring Custom Controls                          scenarios or in situations in which data cannot be lost in the event of a server/process restart.
      Web Forms Controls Reference
      Web Forms Syntax Reference                      3. Avoid excessive round trips to the server: The Web Forms page framework is one of the best features of ASP.NET, because it can
                                                         dramatically reduce the amount of code you need to write to accomplish a task. Programmatic access to page elements using server
                                                         controls and the postback event handling model are arguably the most time-saving features. However, there are appropriate and
    ASP.NET Web Services                                 inappropriate ways to use these features, and it is important to know when it is appropriate to use them.
      Introducing Web Services
      Writing a Simple Web Service                        An application typically needs to make a round trip to the server only when retrieving data or storing data. Most data manipulations can
                                                          take place on the client between round trips. For example, validating form entries can often take place on the client before the user
      Web Service Type Marshalling
                                                          submits data. In general, if you do not need to relay information back to the server, then you should not make a round trip to the
      Using Data in Web Services                          server.
      Using Objects and Intrinsics
      The WebService Behavior                             If you are writing your own server controls, consider having them render client-side code for up-level (ECMAScript-capable) browsers.
      HTML Pattern Matching                               By employing "smart" controls, you can dramatically reduce the number of unecessary hits to your Web server.


                                                      4. Use Page.IsPostback to avoid extra work on a round trip: If you are handling server control postbacks, you often need to
    ASP.NET Web Applications                             execute different code the first time the page is requested from the code you do use for the round trip when an event is fired. If you
      Application Overview                               check the Page.IsPostBack property, your code can execute conditionally, depending on whether there is an initial request for the
      Using the Global.asax File                         page or a responce to a server control event. It might seem obvious to do this, but in practice it is possible to omit this check without
                                                         changing the behavior of the page. For example:
      Managing Application State
      HttpHandlers and Factories


    Cache Services
      Caching Overview
      Page Output Caching

http://samples.gotdotnet.com/quickstart/aspplus/doc/perftuning.aspx (1 of 7) [4/02/2002 8:52:27 AM]
Microsoft ASP.NET QuickStarts Tutorial
      Page Fragment Caching
                                                               <script language="VB" runat="server">
      Page Data Caching
                                                                     Public ds As DataSet
                                                                     ...
    Configuration
      Configuration Overview                                         Sub Page_Load(sender As Object, e As EventArgs)
                                                                         ' ...set up a connection and command here...
      Configuration File Format
                                                                         If Not (Page.IsPostBack)
      Retrieving Configuration                                               Dim query As String = "select * from Authors where FirstName like '%JUSTIN%'"
                                                                             myCommand.Fill(ds, "Authors")
                                                                             myDataGrid.DataBind()
    Deployment                                                           End If
      Deploying Applications                                         End Sub
      Using the Process Model
                                                                     Sub Button_Click(sender As Object, e As EventArgs)
      Handling Errors                                                    Dim query As String = "select * from Authors where FirstName like '%BRAD%'"
                                                                         myCommand.Fill(ds, "Authors")
                                                                         myDataGrid.DataBind()
    Security                                                         End Sub
      Security Overview
      Authentication & Authorization                           </script>

      Windows-based Authentication                             <form runat="server">
      Forms-based Authentication                                 <asp:datagrid datasource='<%# ds.Tables["Authors"].DefaultView %>' runat="server"/><br>
                                                                 <asp:button onclick="Button_Click" runat="server"/>
      Authorizing Users and Roles
                                                               </form>
      User Account Impersonation
      Security and WebServices                            VB


    Localization                                          The Page_Load event executes on every request, so we checked Page.IsPostBack so that the first query does not execute when we
      Internationalization Overview                       process the Button_Click event postback. Note that even without this check our page would behave identically, since the binding
      Setting Culture and Encoding                        from the first query would be overturned by the call to DataBind in the event handler. Keep in mind that it can be easy to overlook this
                                                          simple performance improvement when you write your pages.
      Localizing ASP.NET Applications
      Working with Resource Files
                                                      5. Use server controls sparingly and appropriately: Even though it is extremely easy to use, a server control might not always be
                                                         the best choice. In many cases, a simple rendering or databinding substitution will accomplish the same thing. For example:
    Tracing
      Tracing Overview
      Trace Logging to Page Output
      Application-level Trace Logging


    Debugging
      The SDK Debugger


    Performance
http://samples.gotdotnet.com/quickstart/aspplus/doc/perftuning.aspx (2 of 7) [4/02/2002 8:52:27 AM]
Microsoft ASP.NET QuickStarts Tutorial
      Performance Overview
                                                               <script language="VB" runat="server">
      Performance Tuning Tips
      Measuring Performance                                          Public imagePath As String
                                                                     Sub Page_Load(sender As Object, e As EventArgs)
                                                                         '...retrieve data for imagePath here...
    ASP to ASP.NET Migration                                             DataBind()
      Migration Overview                                             End Sub
      Syntax and Semantics                                     </script>
      Language Compatibility
                                                               <%--the span and img server controls are unecessary...--%>
      COM Interoperability                                     The path to the image is: <span innerhtml='<%# imagePath %>' runat="server"/><br>
      Transactions                                             <img src='<%# imagePath %>' runat="server"/>

                                                               <br><br>
    Sample Applications
                                                               <%-- use databinding to substitute literals instead...--%>
      A Personalized Portal
                                                               The path to the image is: <%# imagePath %><br>
      An E-Commerce Storefront                                 <img src='<%# imagePath %>' />
      A Class Browser Application
                                                               <br><br>
      IBuySpy.com
                                                               <%-- or a simple rendering expression...--%>
                                                               The path to the image is: <%= imagePath %><br>
      Get URL for this page
                                                               <img src='<%= imagePath %>' />


                                                          VB


                                                          In this example, a server control is not needed to substitute values into the resulting HTML sent back to the client. There are many
                                                          other cases where this technique works just fine, even in server control templates. However, if you want to programmatically
                                                          manipulate the control's properties, handle events from it, or take advantage of its state preservation, then a server control would be
                                                          appropriate. You should examine your use of server controls and look for code you can optimize.


                                                      6. Avoid excessive server control view state: Automatic state management is a feature that enables server controls to re-populate
                                                         their values on a round trip without requiring you to write any code. This feature is not free however, since the state of a control is
                                                         passed to and from the server in a hidden form field. You should be aware of when ViewState is helping you and when it is not. For
                                                         example, if you are binding a control to data on every round trip (as in the datagrid example in tip #4), then you do not need the
                                                         control to maintain it's view state, since you will wipe out any re-populated data in any case.


                                                          ViewState is enabled for all server controls by default. To disable it, set the MaintainState property of the control to false, as in the
                                                          following example:


                                                               <asp:datagrid MaintainState="false" datasource="..." runat="server"/>


                                                          You can also turn ViewState off at the page level. This is useful when you do not post back from a page at all, as in the following
                                                          example:


http://samples.gotdotnet.com/quickstart/aspplus/doc/perftuning.aspx (3 of 7) [4/02/2002 8:52:27 AM]
Microsoft ASP.NET QuickStarts Tutorial
                                                               <%@ Page MaintainState="false" %>


                                                          Note that this attribute is also supported by the User Control directive. To analyze the amount of view state used by the server
                                                          controls on your page, enable tracing and look at the View State column of the Control Hierarchy table. For more information about the
                                                          Trace feature and how to enable it, see the Application-level Trace Logging feature.


                                                      7. Use System.Text.StringBuilder for string concatenation: Web applications often need to perform extensive string manipulation.
                                                         Although standard string operators work for concatenation, they have a negative impact on performance. Using the
                                                         System.Text.StringBuilder class to concatenate strings provides better performance, as demonstrated by the following example:



                                                               ' Using concatenation operators can sometimes produce
                                                               ' cleaner-looking code, but performance is not as good.

                                                               Dim begin_query As String = "select UPPER(MachineName) As MachineName, " _
                                                                                         & "LOWER(MachineOwner) As MachineOwner, Status, " _
                                                                                         & "StartTime from NET_STRESS WHERE "

                                                               Dim end_query As String = " AND StartTime > '" & startTime & "' AND StartTime < '" & endTime & "'"

                                                               Dim query As String = begin_query & GetWhereClause("PASSED") & end_query


                                                               ' Consider replacing with StringBuilder instead:

                                                               Dim begin_query As New StringBuilder
                                                               begin_query.Append("select UPPER(MachineName) As MachineName ")
                                                               begin_query.Append("LOWER(MachineOwner) As MachineOwner, Status, ")
                                                               begin_query.Append("StartTime from NET_STRESS WHERE ")

                                                               Dim end_query As New StringBuilder
                                                               end_query.Append(" AND StartTime > '")
                                                               end_query.Append(startTime)
                                                               end_query.Append("' AND StartTime < '")
                                                               end_query.Append(endTime)
                                                               end_query.Append("'")

                                                               Dim query As String = begin_query.Append(GetWhereClause("PASSED")).Append(end_query).ToString()


                                                          VB


                                                      8. Do not rely on exceptions in your code: Exceptions are very expensive and should rarely occur in your code. You should never use
                                                         exceptions as a way to control normal program flow. If it is possible to detect in code a condition that would cause an exception, you
                                                         should do that instead of waiting to catch the exception before handling that condition. Common scenarios include checking for null,
                                                         assigning to a string that will be parsed into a numeric value, or checking for specific values before applying math operations. For
                                                         example:




http://samples.gotdotnet.com/quickstart/aspplus/doc/perftuning.aspx (4 of 7) [4/02/2002 8:52:27 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                                               ' Consider changing this:

                                                               Try
                                                                    result = 100 / num

                                                               Catch (e As Exception)
                                                                 result = 0
                                                               End Try

                                                               // To this:

                                                               If Not (num = 0)
                                                                  result = 100 / num
                                                               Else
                                                                 result = 0
                                                               End If


                                                          VB


                                                      9. Use early binding in Visual Basic or JScript code: One of the advantages of Visual Basic, VBScript, and JScript is their typeless
                                                         nature. Variables can be created simply by using them and need no explicit type declaration. When assigning from one type to another,
                                                         conversions are performed automatically, as well. This can be both an advantage and a disadvantage, since late binding is a very
                                                         expensive convenience in terms of performance.


                                                          The Visual Basic language now supports type-safe programming through the use of a special Option Strict compiler directive. For
                                                          backward compatibility, ASP.NET does not enable Option Strict by default. However, for optimal perfomance, you should enable
                                                          Option Strict for your pages by using a Strict attribute on the page or Control directive:


                                                               <%@ Page Language="VB" Strict="true" %>

                                                               <%

                                                               Dim B
                                                               Dim C As String

                                                               ' This causes a compiler error:
                                                               A = "Hello"

                                                               ' This causes a compiler error:
                                                               B = "World"

                                                               ' This does not:
                                                               C = "!!!!!!"

                                                               ' But this does:
                                                               C = 0

                                                               %>


http://samples.gotdotnet.com/quickstart/aspplus/doc/perftuning.aspx (5 of 7) [4/02/2002 8:52:27 AM]
Microsoft ASP.NET QuickStarts Tutorial
                                                          JScript also supports typeless programming, though it offers no compiler directive to force early binding. A variable is late-bound if:


                                                                r   It is declared explicitly as an object.
                                                                r   It is a field of a class with no type declaration.
                                                                r   It is a private function/method member with no explicit type declaration and the type cannot be inferred from its use.


                                                          The last distinction is complicated. The JScript compiler optimizes if it can figure out the type, based on how a variable is used. In the
                                                          following example, the variable A is early-bound but the variable B is late-bound:


                                                               var A;
                                                               var B;

                                                               A = "Hello";
                                                               B = "World";
                                                               B = 0;


                                                          For the best performance, declare your JScript variables as having a type. For example, "var A : String".


                                                     10. Port call-intensive COM components to managed code: The .NET Framework provides a remarkably easy way to interoperate
                                                         with traditional COM components. The benefit is that you can take advantage of the new platform while preserving your existing code.
                                                         However, there are some circumstances in which the performance cost of keeping your old components is greater than the cost to
                                                         migrate your components to managed code. Every situation is unique, and the best way to decide what needs to be changed is to
                                                         measure site performance. In general, however, the performance impact of COM interoperability is proportional to the number of
                                                         function calls made or the amount of data marshaled from unmanaged to managed code. A component that requires a high volume of
                                                         calls to interact with it is called "chatty," due to the number of communications between layers. You should consider porting such
                                                         components to fully managed code to benefit from the performance gains provided by the .NET platform. Alternatively, you might
                                                         consider redesigning your component to require fewer calls or to marshal more data at once.


                                                     11. Use SQL stored procedures for data access: Of all the data access methods provided by the .NET Framework, SQL-based data
                                                         access is the best choice for building scalable web applications with the best performance. When using the managed SQL provider, you
                                                         can get an additional performance boost by using compiled stored procedures instead of ad hoc queries. For an example of using SQL
                                                         stored procedures, refer to the Server-Side Data Access section of this tutorial.


                                                     12. Use SqlDataReader for a fast-forward, read-only data cursor: A SqlDataReader object provides a forward, read-only cursor
                                                         over data retrieved from a SQL database. Because SqlDataReader uses Tabular Data Stream (TDS) packets to read data directly from
                                                         a database connection, it provides better performance than using a DataSet, if you can use that for your scenario. Because
                                                         SqlDataReader supports the IEnumerable interface, you can even bind server controls, as well. For an example of using
                                                         SqlDataReader, see the Server-Side Data Access section of this tutorial.


                                                     13. Cache data and output wherever possible: The ASP.NET programming model provides a simple mechanism for caching page
                                                         output or data when it does not need to be dynamically computed for every request. You can design your pages with caching in mind to
                                                         optimize those places in your application that you expect to have the most traffic. More than any feature of the .NET Framework, the
                                                         appropriate use of caching can enhance the performance of your site, sometimes by an order of magnitude or more. For more
                                                         information about how to use caching, see the Cache Services section of this tutorial.


http://samples.gotdotnet.com/quickstart/aspplus/doc/perftuning.aspx (6 of 7) [4/02/2002 8:52:27 AM]
Microsoft ASP.NET QuickStarts Tutorial
                                                     14. Enable Web gardening for multiprocessor computers: The ASP.NET process model helps enable scalability on multiprocessor
                                                         machines by distributing the work to several processes, one for each CPU, each with processor affinity set to its CPU. The technique is
                                                         called Web gardening, and can dramatically improve the performance of some applications. To learn how to enable Web gardening,
                                                         refer to the Using the Process Model section.


                                                     15. Do not forget to disable Debug mode: The <compilation> section in ASP.NET configuration controls whether an application is
                                                         compiled in Debug mode, or not. Debug mode degrades performance significantly. Always remember to disable Debug mode before
                                                         you deploy a production application or measure performance. For more information about Debug mode, refer to the section entitled
                                                         The SDK Debugger.




http://samples.gotdotnet.com/quickstart/aspplus/doc/perftuning.aspx (7 of 7) [4/02/2002 8:52:27 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Measuring Performance
 Introduction
 What is ASP.NET?                                    Measuring Web server performance is a skill that can only be refined by
                                                     repeated experience and experimentation. There are many variables at
 Language Support
                                                     play, such as the number of clients, speed of client connections, server
                                                     resources, application code, and so on. It helps to have good tools at your
ASP.NET Web Forms                                    disposal, and fortunately those are available.
 Introducing Web Forms
 Working with Server Controls                        Microsoft provides the Web Application Stress (WAS) tool, which simulates
                                                     multiple HTTP clients hitting your Web site. You can control the client load,
 Applying Styles to Controls                         number of connections, format of cookies, headers, and several other
 Server Control Form Validation                      parameters from the tool's graphical interface. After a test run, WAS
 Web Forms User Controls                             provides you with reports containing performance metrics such as response
                                                     time, throughput, and performance counter data relevant to your
 Data Binding Server Controls                        application. The goal is simple: to maximize throughput and CPU utilization
 Server-Side Data Access                             under high degrees of load. WAS is available from the Microsoft Internet
 Data Access and Customization                       Information Server Resource Kit and is also downloadable separately from
                                                     http://webtool.rte.microsoft.com.
 Working with Business Objects
 Authoring Custom Controls
                                                     ASP.NET also exposes a number of performance counters that can be used
 Web Forms Controls Reference                        to track the execution of your applications. Unlike traditional ASP, most of
 Web Forms Syntax Reference                          these performance counters are exposed per-application, instead of
                                                     globally for the entire machine. The per-application counters are available
                                                     under the ASP.NET Applications performance object, and you need to
ASP.NET Web Services                                 select a particular application instance when selecting a counter to monitor.
 Introducing Web Services                            Of course, you can still see the counter values for all applications using a
                                                     special "__Total__" application instance in System Monitor. ASP.NET also
 Writing a Simple Web Service
                                                     exposes global-only counters which are not bound to a particular
 Web Service Type Marshalling                        application instance. These counters are located under the ASP.NET
 Using Data in Web Services                          System performance object. To view all available counters for ASP.NET (on
                                                     Windows 2000 systems):
 Using Objects and Intrinsics
 The WebService Behavior
                                                           1. Select Start->Programs->Administrative Tools-
 HTML Pattern Matching
                                                              >Performance.
                                                           2. Click the View Report button in System Monitor.
                                                           3. Click the Add button.
ASP.NET Web Applications
                                                           4. Select ASP.NET Applications, then choose the All counters
 Application Overview                                         radio button. Click OK.
 Using the Global.asax File                                5. Select ASP.NET System, then choose the All counters radio
 Managing Application State                                   button. Click OK.

 HttpHandlers and Factories
                                                     The ASP.NET Trace feature is also useful for identifying performance
                                                     bottlenecks in your code. It can show you important timing information
Cache Services                                       between successive trace output statements, as well as information about
 Caching Overview                                    the server control heierarchy, the amount of viewstate used, and the
                                                     render size of controls on your page. For more information about the Trace
 Page Output Caching
                                                     feature, refer to the Tracing section of this tutorial.
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/perfmeasure.aspx (1 of 2) [4/02/2002 8:52:29 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/perfmeasure.aspx (2 of 2) [4/02/2002 8:52:29 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      Migration Overview
 Introduction
 What is ASP.NET?                                    Installing ASP.NET will not break your existing ASP applications. It uses a
                                                     separate file name extension (.aspx instead of .asp), separate configuration
 Language Support
                                                     settings, and an entirely separate common language runtime (Asp.dll has
                                                     not been modified). ASP pages and applications can continue to use the
ASP.NET Web Forms                                    existing ASP engine, with no interference from ASP.NET. That said, the
                                                     benefits of migrating your existing applications to ASP.NET are enormous.
 Introducing Web Forms                               ASP.NET easily provides many times the features of traditional ASP, and
 Working with Server Controls                        moving your ASP applications to the new platform provides a huge
 Applying Styles to Controls                         opportunity for improvement. Among the new features you can take
                                                     advantage of are:
 Server Control Form Validation
 Web Forms User Controls
                                                            q   Improved performance and scalability
 Data Binding Server Controls                               q   Web farm support and XCopy deployment
 Server-Side Data Access                                    q   Output caching and custom security
 Data Access and Customization                              q   Web Forms page controls
                                                            q   Web Services infrastructure
 Working with Business Objects
 Authoring Custom Controls
                                                     ASP.NET is designed to help preserve your investment in traditional ASP
 Web Forms Controls Reference                        and COM technologies. It balances support for existing ASP syntax and
 Web Forms Syntax Reference                          semantics with the need for a forward-looking platform that can last well
                                                     into the next age of Internet application development. While ASP.NET
                                                     preserves the majority of ASP's feature set, 100% compatibility between
ASP.NET Web Services                                 the two was not possible if the platform was to move forward, so there are
 Introducing Web Services                            a few changes to the old way of doing things.
 Writing a Simple Web Service
 Web Service Type Marshalling                        The good news is that your ASP skills will translate easily to ASP.NET.
                                                     There are only a few differences, which are usually easy to fix. However,
 Using Data in Web Services                          migrating ASP applications to ASP.NET does require some work. Relatively
 Using Objects and Intrinsics                        simple pages might migrate without any changes, but more complex
 The WebService Behavior                             applications probably will require some modifications. The following
                                                     sections describe the changes and the ways in which they might affect your
 HTML Pattern Matching                               existing application code. They also demonstrate some of the ways in
                                                     which you can reuse ASP and COM code in ASP.NET.
ASP.NET Web Applications
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/migrationoverview.aspx (1 of 2) [4/02/2002 8:52:30 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/migrationoverview.aspx (2 of 2) [4/02/2002 8:52:30 AM]
Microsoft ASP.NET QuickStarts Tutorial

Getting Started                           Syntax and Semantics
 Introduction
 What is ASP.NET?                         ASP.NET is fully API-compatible with traditional ASP, with the following three exceptions:
 Language Support
                                                q   Request(): ASP returns an array of strings; ASP.NET returns a string.
                                                q   Request.QueryString(): ASP returns an array of strings; ASP.NET returns a string.
ASP.NET Web Forms                               q   Request.Form(): ASP returns an array of strings; ASP.NET returns a string.
 Introducing Web Forms
 Working with Server Controls             In ASP, the Request, Request.QueryString, and Request.Form collections return string
 Applying Styles to Controls              arrays from lookups. For example, in traditional ASP the query string values from a request to
                                          http://localhost/test/Test.asp?values=45&values=600 would be accessed as follows:
 Server Control Form Validation
 Web Forms User Controls
                                               <%
 Data Binding Server Controls                         ' Below line outputs: "45, 600"
 Server-Side Data Access                              Response.Write Request.QueryString("values")
 Data Access and Customization
                                                      ' Below line outputs: "45"
 Working with Business Objects                        Response.Write Request.QueryString("values")(1)
 Authoring Custom Controls                     %>
 Web Forms Controls Reference
 Web Forms Syntax Reference               In ASP.NET, these collections require an explicit method to get array access. These arrays are
                                          also now 0-index based. For example, in ASP.NET the query string values from a request to
                                          http://localhost/test/Test.aspx?values=45&values=600 would be accessed as follows:
ASP.NET Web Services
 Introducing Web Services
 Writing a Simple Web Service                  <%
                                                      ' Below line outputs: "45, 600"
 Web Service Type Marshalling                         Response.Write(Request.QueryString("values"))
 Using Data in Web Services
                                                      ' Below line outputs: "45"
 Using Objects and Intrinsics
                                                      Response.Write(Request.QueryString.GetValues("values")(0))
 The WebService Behavior                       %>
 HTML Pattern Matching
                                          VB
ASP.NET Web Applications
 Application Overview                     These arrays are most commonly used when form values are posted from multiselect list
 Using the Global.asax File               boxes (<select multiple>) or when multiple check boxes have the same name.

 Managing Application State
 HttpHandlers and Factories               Semantic Differences Between ASP.NET and ASP

                                          ASP.NET pages also have several semantic changes from existing ASP pages. The following
Cache Services                            issues are the ones most likely to affect you:
 Caching Overview
 Page Output Caching
                                                q   ASP.NET pages only support a single language.
 Page Fragment Caching
 Page Data Caching                                  ASP allowed multiple languages to be used on a single page, which was useful for
                                                    script library scenarios. Because of ASP.NET's compiled nature, it supports only a
                                                    single language on a page. However, it is still possible to have multiple pages, each
Configuration                                       with a separate language, within a single application. User Controls might also have
 Configuration Overview                             a different language from the page that contains them. This enables you to integrate
 Configuration File Format                          functionality written in different languages in a single page. This is an adequate
 Retrieving Configuration                           substitute for the multiple-language Include files that are prevalent in traditional ASP
                                                    applications.

Deployment                                      q   ASP.NET page functions must be declared in <script runat=server> blocks.
 Deploying Applications
 Using the Process Model                            In ASP, page functions could be declared within <% %> blocks:
 Handling Errors
                                                         <%
Security                                                       Sub DoSomething()
                                                                   Response.Write "Hello World!"
 Security Overview                                             End Sub



http://samples.gotdotnet.com/quickstart/aspplus/doc/syntaxandsemantics.aspx (1 of 2) [4/02/2002 8:52:32 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Authentication & Authorization
                                                                DoSomething
 Windows-based Authentication                             %>
 Forms-based Authentication
 Authorizing Users and Roles                         In ASP.NET, page functions must be declared in <script runat=server> blocks:
 User Account Impersonation
 Security and WebServices
                                                          <script language="VB" runat=server>

Localization                                                    Sub DoSomething()
 Internationalization Overview                                      Response.Write ("Hello World!")
                                                                End Sub
 Setting Culture and Encoding
 Localizing ASP.NET Applications                          </script>
 Working with Resource Files                              <%
                                                                DoSomething()
                                                          %>
Tracing
 Tracing Overview
                                                     VB
 Trace Logging to Page Output
 Application-level Trace Logging
                                                 q   ASP.NET does not support page-render functions.

Debugging                                            In ASP, page-render functions could be declared with <% %> blocks:
 The SDK Debugger

                                                          <% Sub RenderSomething() %>
Performance                                                      <font color="red"> Here is the time: <%=Now %> </font>
 Performance Overview                                     <% End Sub %>

 Performance Tuning Tips                                  <%
 Measuring Performance                                         RenderSomething
                                                               RenderSomething
                                                          %>
ASP to ASP.NET Migration
 Migration Overview                                  In ASP.NET, this must be rewritten:
 Syntax and Semantics
 Language Compatibility
 COM Interoperability                                     <script language="VB" runat=server>

 Transactions                                                    Sub RenderSomething()
                                                                    Response.Write("<font color=red> ")
                                                                    Response.Write("Here is the time: " & Now)
Sample Applications                                              End Sub
 A Personalized Portal
                                                          </script>
 An E-Commerce Storefront
 A Class Browser Application                              <%
 IBuySpy.com                                                   RenderSomething()
                                                               RenderSomething()
                                                          %>
 Get URL for this page
                                                     VB


                                           Section Summary

                                                1. With three exceptions, ASP.NET is 100% API-compatible with traditional ASP. The
                                                   API changes are that, now, Request(), Request.QueryString(), and
                                                   Request.Form() all return individual strings, rather than string arrays.
                                                2. ASP.NET pages support only a single language.
                                                3. ASP.NET page functions must be declared in <script runat=server> blocks.
                                                4. Page-render functions are not supported.




 http://samples.gotdotnet.com/quickstart/aspplus/doc/syntaxandsemantics.aspx (2 of 2) [4/02/2002 8:52:32 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                             Language Compatibility
 Introduction
 What is ASP.NET?                           The differences between the VBScript used in ASP and the Visual Basic.NET language
                                            used in ASP.NET are by far the most extensive of all the potential migration issues.
 Language Support
                                            Not only has ASP.NET departed from the VBScript language to "true" Visual Basic, but
                                            the Visual Basic language itself has undergone significant changes in this release. The
ASP.NET Web Forms                           changes are designed to:
 Introducing Web Forms
 Working with Server Controls                      q   Make the language more consistent by bringing together features of the
                                                       language with similar purposes.
 Applying Styles to Controls                       q   Simplify the language by redesigning the features that made Visual Basic less
 Server Control Form Validation                        than "basic."
 Web Forms User Controls                           q   Improve readability and maintainability by redesigning features that hid too
                                                       many important details from the programmer.
 Data Binding Server Controls                      q   Improve robustness by enforcing better practices, such as type-safe
 Server-Side Data Access                               programming.
 Data Access and Customization
 Working with Business Objects              This section highlights some common issues you are likely to encounter when you
                                            begin to use the new Visual Basic language.
 Authoring Custom Controls
 Web Forms Controls Reference
                                                   q   No more Set and Let. Instead, use simple variable assignment.
 Web Forms Syntax Reference

                                                            <%
ASP.NET Web Services                                              ' Old ASP syntax.
 Introducing Web Services                                         Dim MyConn
                                                                  Set MyConn = Server.CreateObject("ADODB.Connection")
 Writing a Simple Web Service
 Web Service Type Marshalling                                     ' New ASP.NET syntax.
 Using Data in Web Services                                       Dim MyConn
                                                                  MyConn = Server.CreateObject("ADODB.Connection")
 Using Objects and Intrinsics                               %>
 The WebService Behavior
 HTML Pattern Matching                             q   No more non-indexed default properties. Non-indexed default
                                                       properties enable an expression that normally refers to an object to refer to
                                                       a default property of the object instead. The unfortunate consequence of
ASP.NET Web Applications                               support for default properties is that it makes programs more difficult to
 Application Overview                                  read, since the meaning of an expression depends on its context. In Visual
 Using the Global.asax File                            Basic.NET, non-indexed properties must always be specified explicitly within
                                                       code.
 Managing Application State
 HttpHandlers and Factories
                                                            <%
                                                            ' Old ASP syntax (retrieving recordset column value).
Cache Services                                              Set MyConn = Server.CreateObject("ADODB.Connection")
                                                            MyConn.Open("TestDB")
 Caching Overview
                                                            Set RS = MyConn.Execute("Select * from Products")
 Page Output Caching                                        Response.Write RS("Name")
 Page Fragment Caching
                                                            ' New ASP.NET syntax (retrieving recordset column value).
 Page Data Caching                                          MyConn = Server.CreateObject("ADODB.Connection")
                                                            MyConn.Open("TestDB")
                                                            RS = MyConn.Execute("Select * from Products")
Configuration                                               Response.Write RS("Name").Value
 Configuration Overview                                     %>
 Configuration File Format
 Retrieving Configuration                              Indexed default properties are still supported:


Deployment                                                  <%
 Deploying Applications                                     Dim RS As RecordSet

 Using the Process Model                                    ' This is allowed (indexed).
 Handling Errors                                            RS.Fields(1).Value = RS.Fields(2).Value




http://samples.gotdotnet.com/quickstart/aspplus/doc/languagecompat.aspx (1 of 3) [4/02/2002 8:52:34 AM]
Microsoft ASP.NET QuickStarts Tutorial

                                                            ' But these are not allowed (non-indexed).
Security                                                    RS(1) = RS(2)
 Security Overview                                          RS(1).Value = RS(2).Value
 Authentication & Authorization                             %>
 Windows-based Authentication
 Forms-based Authentication                        q   Parentheses are now required for calling subroutines. Visual Basic
                                                       now supports exactly the same syntax for calling subroutines and functions.
 Authorizing Users and Roles
 User Account Impersonation
                                                            ' Note parentheses with Response.Write.
 Security and WebServices                                   Sub DoSomething()
                                                                 Response.Write("Hello World!")
                                                            End Sub
Localization
 Internationalization Overview                              ' Note parenthesws with DoSomething.
 Setting Culture and Encoding                               DoSomething()

 Localizing ASP.NET Applications
 Working with Resource Files                       q   The new default is by-value arguments. In Visual Basic 6, if a user does
                                                       not explicitly specify ByVal or ByRef on a parameter declaration, the calling
                                                       convention defaults to ByRef. In the new Visual Basic.NET, the default is
Tracing                                                ByVal. This applies both to regular parameters for which the default can be
 Tracing Overview                                      overridden by explicitly specifying ByRef and to parameters passed to a
                                                       ParamArray parameter where the default can not be overridden. This has
 Trace Logging to Page Output                          been changed because it is much more common for a parameter to be used
 Application-level Trace Logging                       solely for passing a value into a procedure than for altering a passed-in
                                                       variable. Changing the default to ByVal increases performance and
                                                       decreases the likleihood of accidental side-effects.
Debugging
 The SDK Debugger
                                                       You can still use by-reference arguments by explicitly using the ByRef
                                                       modifier:
Performance
 Performance Overview                                       <script language="VB" runat=server>
 Performance Tuning Tips
                                                                 Sub DoSomething(ByRef value)
 Measuring Performance                                              value = 4343
                                                                 End Sub

ASP to ASP.NET Migration                                    </script>
 Migration Overview
                                                            <%
 Syntax and Semantics                                            Dim number = 55
 Language Compatibility                                          DoSomething (number)
 COM Interoperability                                            Response.Write ("Number: " & number)
                                                            %>
 Transactions

                                            Note: There are many additional differences between Visual Basic 6 and Visual
Sample Applications                         Basic.NET. Consult the language documentation for more information.
 A Personalized Portal
 An E-Commerce Storefront                   Section Summary
 A Class Browser Application
 IBuySpy.com                                      1. The differences between the VBScript used in ASP and the Visual Basic.NET
                                                     language used in ASP.NET are by far the most extensive of all the potential
                                                     migration issues. The changes have been made to simplify the language and
 Get URL for this page
                                                     improve consistency, readability, maintainability, and robustness.
                                                  2. Set and Let assignments are no longer supported in Visual Basic.NET. Use
                                                     standard variable assignment instead.
                                                  3. Non-indexed default properties are not supported in Visual Basic.NET.
                                                     Indexed default properties are still supported.
                                                  4. Parentheses are required for calling subroutines in Visual Basic.NET.
                                                  5. The new default is by-value arguments. You can still use by-reference
                                                     arguments by explicitly using the ByRef modifier.




http://samples.gotdotnet.com/quickstart/aspplus/doc/languagecompat.aspx (2 of 3) [4/02/2002 8:52:34 AM]
Microsoft ASP.NET QuickStarts Tutorial




http://samples.gotdotnet.com/quickstart/aspplus/doc/languagecompat.aspx (3 of 3) [4/02/2002 8:52:34 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      COM Interoperability
 Introduction
 What is ASP.NET?                                    The common language runtime enables .NET objects to interoperate
                                                     seamlessly with traditional COM components. ASP.NET exposes the familiar
 Language Support
                                                     Server.CreateObject(ProgId) API to developers for creating late-bound
                                                     references to COM.
ASP.NET Web Forms
 Introducing Web Forms                                     Dim myConn
                                                           myConn = Server.CreateObject("ADODB.Connection");
 Working with Server Controls
 Applying Styles to Controls
                                                     You can also use early-bound, traditional COM components by creating
 Server Control Form Validation
                                                     runtime callable wrappers (RCWs), which optimize the performance of calls
 Web Forms User Controls                             between unmanaged and managed code. You can create an RCW using the
 Data Binding Server Controls                        Tlbimp.exe utility included in the .NET Framework SDK. For more
                                                     information on Tlbimp.exe, see the Interoperability section of the Common
 Server-Side Data Access
                                                     Tasks QuickStart. The ASP.NET Performance section contains more
 Data Access and Customization
                                                     information comparing late binding with early binding.
 Working with Business Objects
 Authoring Custom Controls
                                                     Like ASP, you can also create traditional COM components using the
 Web Forms Controls Reference                        <object> tag with either a progid or a classid attribute. In addition
 Web Forms Syntax Reference                          to using the <object> tag in pages, you can also use it in the Global.asax
                                                     file for the application. In this case, the object is added to the
                                                     Page.Application.StaticObjects collection and can be accessed
ASP.NET Web Services                                 programmatically by simply using its id attribute. Note that you cannot
 Introducing Web Services                            create single-threaded apartment (STA) objects statically in the Global.asax
                                                     file because doing so generates a runtime error, as it does in ASP.
 Writing a Simple Web Service
 Web Service Type Marshalling
                                                     ASP.NET also continues to support the existing ASP intrinsic interfaces
 Using Data in Web Services                          ObjectContext Intrinsic Flow, OnStartPage, and OnEndPage.
 Using Objects and Intrinsics                        Supporting these interfaces means that you can use existing components
 The WebService Behavior                             (Commerce Server, Exchange, and so on) in ASP.NET pages. These
                                                     interfaces are not enabled by default but are explicitly turned on using the
 HTML Pattern Matching                               following page directive:


ASP.NET Web Applications                                   <%@ Page ASPCompat="true" %>
 Application Overview
 Using the Global.asax File                          This directive causes ASP.NET to create unmanaged ASP intrinsic objects
 Managing Application State                          and pass them to COM components used in the page. It also runs the page
                                                     in an STA thread pool. See the following section for information.
 HttpHandlers and Factories

                                                     Performance Considerations
Cache Services
 Caching Overview
                                                     In ASP.NET, the thread pool is a multithreaded apartment (MTA) by
 Page Output Caching                                 default, which can affect the performance of traditional apartment-
 Page Fragment Caching                               threaded Visual Basic 5 and Visual Basic 6 components. The
 Page Data Caching                                   ASPCompat="true" attribute enables an STA thread pool to address
                                                     performance with existing Visual Basic components on a per-page basis.

Configuration                                        Calling between managed and unmanaged components also incurs a
 Configuration Overview                              marshaling cost, which can impede the performance of your pages. Every
 Configuration File Format                           scenario yields different performance characteristics, so it is important to
                                                     test adequately before deciding whether interoperability is the right choice
 Retrieving Configuration
                                                     for your application. However, in nearly all scenarios, rewriting your COM
                                                     components in managed code provides performance benefits. See the
                                                     ASP.NET Performance section for more information and important tips.
Deployment
 Deploying Applications
 Using the Process Model                             Section Summary

http://samples.gotdotnet.com/quickstart/aspplus/doc/cominterop.aspx (1 of 2) [4/02/2002 8:52:35 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors
                                                           1. ASP.NET exposes the familiar Server.CreateObject API to
                                                              developers for creating late-bound references to COM.
Security                                                   2. You can also use early-bound, traditional COM components by
 Security Overview                                            creating runtime callable wrappers, which optimize the
 Authentication & Authorization                               performance of calls between unmanaged and managed code.
                                                           3. ASP.NET continues to support the existing ASP intrinsic interfaces
 Windows-based Authentication                                 ObjectContext Intrinsic Flow, OnStartPage, and
 Forms-based Authentication                                   OnEndPage. These interfaces are explicitly enabled using the
 Authorizing Users and Roles                                  page directive <%@ Page ASPCompat="true" %>.
                                                           4. The ASPCompat="true" attribute enables STA thread pools on a
 User Account Impersonation
                                                              per-page basis to address performance with existing Visual Basic
 Security and WebServices                                     components.
                                                           5. In nearly all scenarios, rewriting your COM components in
                                                              managed code provides performance benefits.
Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/cominterop.aspx (2 of 2) [4/02/2002 8:52:35 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                     MTS Transactions
 Introduction
 What is ASP.NET?                                   A transaction is an operation or set of operations that succeeds or fails as a
                                                    logical unit. A good example of a transaction is the transfer of funds from
 Language Support
                                                    one bank account to another. In this case, the funds must be debited from
                                                    the first account and credited to the second account before the operation
ASP.NET Web Forms                                   can be considered a success. If the funds are successfully debited but not
                                                    credited, the debit from the first account must be undone to leave both
 Introducing Web Forms                              accounts in a correct and consistent state.
 Working with Server Controls
 Applying Styles to Controls                        Transactions are normally managed by declaring boundaries around a set of
 Server Control Form Validation                     operations. Operations that execute in the context of the transaction
 Web Forms User Controls                            boundary then succeed or fail as a unit. For ASP.NET, the transaction
                                                    boundary is the execution of a single request to a page, which might contain
 Data Binding Server Controls                       nested components that participate in the same transaction. While the page
 Server-Side Data Access                            is executing, if an operation on the page itself or a nested component in the
 Data Access and Customization                      same transaction fails, it can call ContextUtil.SetAbort. This is then picked
                                                    up by the current transaction context, the entire transaction fails, and any
 Working with Business Objects                      operations that were already completed are undone. If nothing fails, the
 Authoring Custom Controls                          transaction is committed.
 Web Forms Controls Reference
 Web Forms Syntax Reference                         ASP.NET support for transactions consists of the ability to allow pages to
                                                    participate in ongoing Microsoft .NET Framework transactions. Transaction
                                                    support is exposed via an @Transaction directive that indicates the desired
ASP.NET Web Services                                level of support:
 Introducing Web Services
 Writing a Simple Web Service                             <%@ Transaction="Required" %>
 Web Service Type Marshalling
 Using Data in Web Services                         The following table defines the supported transaction attributes. The
                                                    absence of a transaction directive is the same as an explicit directive to
 Using Objects and Intrinsics
                                                    "Disabled". Unlike ASP, ASP.NET has no explicit directive for none (that is,
 The WebService Behavior                            Transaction="None").
 HTML Pattern Matching

                                                     Attribute            Description
ASP.NET Web Applications
                                                     Required             The page requires a transaction. It runs
 Application Overview                                                     in the context of an existing transaction,
 Using the Global.asax File                                               if one exists. If not, it starts one.
 Managing Application State                          RequiresNew          The page requires a transaction and a
 HttpHandlers and Factories                                               new transaction is started for each
                                                                          request.

Cache Services                                       Supported            The page runs in the context of an
 Caching Overview                                                         existing transaction, if one exists. If not,
                                                                          it runs without a transaction.
 Page Output Caching
 Page Fragment Caching                               NotSupported The page does not run within the scope
                                                                  of transactions. When a request is
 Page Data Caching                                                processed, its object context is created
                                                                  without a transaction, regardless of
                                                                  whether there is an active transaction.
Configuration
 Configuration Overview
 Configuration File Format                          A transaction can be explicitly committed or aborted using static methods of
                                                    the System.EnterpriseServices.ContextUtil class. You can explicitly call
 Retrieving Configuration
                                                    the SetComplete or SetAbort method to commit or abort an ongoing
                                                    transaction.
Deployment
 Deploying Applications
                                                          ' Try to do something crucial to transaction completing.
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/mtstransactions.aspx (1 of 2) [4/02/2002 8:52:37 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors                                          If (Not DoSomeWork())
                                                              ContextUtil.SetAbort()
                                                          End If
Security
 Security Overview                                  VB
 Authentication & Authorization
 Windows-based Authentication                       Section Summary
 Forms-based Authentication
 Authorizing Users and Roles                              1. A transaction is an operation or set of operations that succeeds or
 User Account Impersonation                                  fails as a logical unit.
 Security and WebServices                                 2. ASP.NET transaction support consists of the ability to allow pages
                                                             to participate in ongoing Microsoft .NET Framework transactions.
                                                             Transaction support is exposed via an @Transaction directive that
Localization                                                 indicates the desired level of support.
                                                          3. A transaction can be explicitly committed or aborted using static
 Internationalization Overview
                                                             methods of the System.EnterpriseServices.ContextUtil class.
 Setting Culture and Encoding                                Developers can explicitly call the SetComplete or SetAbort
 Localizing ASP.NET Applications                             method to commit or abort an ongoing transaction.
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/mtstransactions.aspx (2 of 2) [4/02/2002 8:52:37 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      A Personalized Portal
 Introduction
 What is ASP.NET?                                    This sample illustrates a personalized portal home page application. The
                                                     application allows users to customize a home page to show various
 Language Support
                                                     modules of their choosing, such as a site directory or favorite links list.
                                                     Each module is implemented as a user control, which is dynamically added
ASP.NET Web Forms                                    to the home page if the user has chosen to include it. The custom
                                                     personalization settings are maintained in a SQL database and are retrieved
 Introducing Web Forms                               using a personalization HTTP module component (which works much as the
 Working with Server Controls                        session state and application state HTTP modules do). Every page in the
 Applying Styles to Controls                         application inherits from a common code-behind base Page class, which
                                                     uses the personalization component to expose a special dictionary called
 Server Control Form Validation                      UserState. This UserState dictionary provides the application's pages with
 Web Forms User Controls                             access to the per-user customization settings (as key/value string pairs). In
 Data Binding Server Controls                        addition to storing the user's module selections, the UserState dictionary
                                                     stores other customization parameters such as color schemes. Individual
 Server-Side Data Access                             modules can use the UserState dictionary to store their own customization
 Data Access and Customization                       settings as well.
 Working with Business Objects
 Authoring Custom Controls                           The portal application employs the FormsAuthenticationModule for
 Web Forms Controls Reference                        user authentication. When a user first requests the home page, the settings
                                                     for an anonymous user are displayed. If the user tries to access a portion
 Web Forms Syntax Reference                          of the portal that is restricted to authenticated users (such as the module
                                                     customization page), the FormsAuthenticationModule redirects the user
                                                     to a login page to enter credentials. A user who has not logged in before
ASP.NET Web Services                                 can use a registration form to create a new user account and password. On
 Introducing Web Services                            subsequent visits to the portal home page, a user can simply log in using
 Writing a Simple Web Service                        these account credentials (which are then verified against a SQL database).
 Web Service Type Marshalling
 Using Data in Web Services                          To get started exploring the portal application, follow the steps described
                                                     above to create a user account. Once your account is created you can
 Using Objects and Intrinsics                        browse and customize the entire portal.
 The WebService Behavior
 HTML Pattern Matching


ASP.NET Web Applications
 Application Overview
 Using the Global.asax File
 Managing Application State                                   VB Portal Application
 HttpHandlers and Factories
                                                             [Run Sample] | [View Source]
Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/portalapp.aspx (1 of 2) [4/02/2002 8:52:39 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/portalapp.aspx (2 of 2) [4/02/2002 8:52:39 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                     An E-Commerce Storefront
 Introduction
 What is ASP.NET?                                   The following sample application is a mock-up of a typical e-commerce
                                                    storefront. The application shows the most common elements of the
 Language Support
                                                    following types of applications: a product browser, a session-based
                                                    shopping cart, product details, and so forth. A SQL Server database is used
ASP.NET Web Forms                                   to store the product data, and the DataList and Repeater controls render
                                                    this data. The data access portion of the application is implemented as a
 Introducing Web Forms                              managed component.
 Working with Server Controls
 Applying Styles to Controls
 Server Control Form Validation
 Web Forms User Controls
 Data Binding Server Controls
 Server-Side Data Access
 Data Access and Customization
                                                            VB GrocerToGo.aspx
 Working with Business Objects
 Authoring Custom Controls                                 [Run Sample] | [View Source]
 Web Forms Controls Reference
 Web Forms Syntax Reference


ASP.NET Web Services
 Introducing Web Services
 Writing a Simple Web Service
 Web Service Type Marshalling
 Using Data in Web Services
 Using Objects and Intrinsics
 The WebService Behavior
 HTML Pattern Matching


ASP.NET Web Applications
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/ecommerceapp.aspx (1 of 2) [4/02/2002 8:52:41 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/ecommerceapp.aspx (2 of 2) [4/02/2002 8:52:41 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                     A Class Browser Application
 Introduction
 What is ASP.NET?                   The following sample application implements a .NET Framework-based class browser, using the System.Reflection APIs to
                                    gather information about a class. To simplify the .aspx code, the application employs a managed component that
 Language Support
                                    encapsulates the reflection details. The .aspx page itself relies heavily on several DataList controls for rendering the
                                    namespaces, classes, and class details. The sample also shows the use of nested DataList controls for rendering the
ASP.NET Web Forms                   parameter lists. To view the sample, click the icon below.
 Introducing Web Forms
 Working with Server Controls
 Applying Styles to Controls
 Server Control Form Validation
 Web Forms User Controls
 Data Binding Server Controls
 Server-Side Data Access                    VB ClassBrowser.aspx
 Data Access and Customization
 Working with Business Objects             [Run Sample] | [View Source]
 Authoring Custom Controls
 Web Forms Controls Reference       The class browser also uses the ASP.NET configuration system to determine which modules to load and reflect upon. A
 Web Forms Syntax Reference         configuration section is mapped to the HashtableSectionHandler, which maintains key/value pairs for the assembly name
                                    and file. You can add assemblies to this list by appending a line to the class browser application's configuration section, as
                                    follows:
ASP.NET Web Services
 Introducing Web Services                 <configuration>
 Writing a Simple Web Service
                                               <configSections>
 Web Service Type Marshalling                     <add name="ClassBrowser" type="System.Configuration.NameValueSectionHandler,System"/>
 Using Data in Web Services                    </configSections>
 Using Objects and Intrinsics                  <ClassBrowser>
 The WebService Behavior                          <set key="ASP.NET Class Library" value="System.Web" />
 HTML Pattern Matching                            <set key=".NET Framework class Library" value="mscorlib" />
                                               </ClassBrowser>

ASP.NET Web Applications                  </configuration>
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model
 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


 http://samples.gotdotnet.com/quickstart/aspplus/doc/classbrowser.aspx (1 of 2) [4/02/2002 8:52:43 AM]
 Microsoft ASP.NET QuickStarts Tutorial


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


Get URL for this page




 http://samples.gotdotnet.com/quickstart/aspplus/doc/classbrowser.aspx (2 of 2) [4/02/2002 8:52:43 AM]
Microsoft ASP.NET QuickStarts Tutorial


Getting Started                                      IBuySpy.com
 Introduction
 What is ASP.NET?                                    The IBuySpy ASP.NET sample application was built to show how you can
                                                     use the new Microsoft .NET Framework and ASP.NET to build a full-
 Language Support
                                                     featured e-commerce application. It offers all the functionality of typical
                                                     shopping applications, including product searches, shopping cart
ASP.NET Web Forms                                    management, user login and registration, and even the ability to view and
                                                     edit your own product reviews.
 Introducing Web Forms
 Working with Server Controls
                                                     Portions of IBuySpy were designed and developed by Vertigo Software,
 Applying Styles to Controls                         Inc.
 Server Control Form Validation
 Web Forms User Controls
 Data Binding Server Controls
 Server-Side Data Access
 Data Access and Customization
 Working with Business Objects
 Authoring Custom Controls
                                                              IBuySpy.com
 Web Forms Controls Reference
 Web Forms Syntax Reference                                  [View Sample]

ASP.NET Web Services
 Introducing Web Services
 Writing a Simple Web Service
 Web Service Type Marshalling
 Using Data in Web Services
 Using Objects and Intrinsics
 The WebService Behavior
 HTML Pattern Matching


ASP.NET Web Applications
 Application Overview
 Using the Global.asax File
 Managing Application State
 HttpHandlers and Factories


Cache Services
 Caching Overview
 Page Output Caching
 Page Fragment Caching
 Page Data Caching


Configuration
 Configuration Overview
 Configuration File Format
 Retrieving Configuration


Deployment
 Deploying Applications
 Using the Process Model


http://samples.gotdotnet.com/quickstart/aspplus/doc/ibuyspy.aspx (1 of 2) [4/02/2002 8:52:44 AM]
Microsoft ASP.NET QuickStarts Tutorial

 Handling Errors


Security
 Security Overview
 Authentication & Authorization
 Windows-based Authentication
 Forms-based Authentication
 Authorizing Users and Roles
 User Account Impersonation
 Security and WebServices


Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output
 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance
 Performance Overview
 Performance Tuning Tips
 Measuring Performance


ASP to ASP.NET Migration
 Migration Overview
 Syntax and Semantics
 Language Compatibility
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application
 IBuySpy.com


 Get URL for this page




http://samples.gotdotnet.com/quickstart/aspplus/doc/ibuyspy.aspx (2 of 2) [4/02/2002 8:52:44 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro1.aspx


                              Name:                                                     Category:
                                                              psychology


                                                                    Lookup




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro1.aspx [4/02/2002 8:52:45 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro2.aspx


                              Name:                                                     Category:
                                                              psychology


                                                                    Lookup

                                                                Welcome to ASP.NET
                                                              Welcome to ASP.NET
                                                           Welcome to ASP.NET
                                                         Welcome to ASP.NET
                                                    Welcome to ASP.NET
                                             Welcome to ASP.NET
                                     Welcome to ASP.NET
                Welcome to ASP.NET




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro2.aspx [4/02/2002 8:52:46 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro3.aspx


                              Name:                                                     Category:
                                                              psychology


                                                                    Lookup




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro3.aspx [4/02/2002 8:52:47 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro4.aspx


                              Name:                                                     Category:
                                                              psychology


                                                                    Lookup




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro4.aspx [4/02/2002 8:52:48 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro5.aspx




                              Name:                                                     Category:
                                                              psychology


                                                                    Lookup




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro5.aspx [4/02/2002 8:52:49 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro6.aspx




                              Name:                                                     Category:
                                                              psychology


                                                                    Lookup




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro6.aspx [4/02/2002 8:52:50 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro7.aspx




                              Name:                                                         Category:
                                                               psychology


                                                                    Lookup


                                                           February 2002
                                            Sun Mon Tue Wed Thu Fri Sat
                                                                                            1   2
                                                 3         4       5         6          7   8   9
                                               10       11       12        13      14 15 16
                                               17       18       19        20      21 22 23
                                               24       25       26        27      28




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro7.aspx [4/02/2002 8:52:52 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/Intro8.aspx




                              Name:                                                     Category:
                                                             psychology


                                                                    Lookup




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/Intro8.aspx [4/02/2002 8:52:53 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/Intro9.aspx




                              Name:                                                     Category:
                                                             psychology


                                                                    Lookup




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/Intro9.aspx [4/02/2002 8:52:54 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/Intro10.aspx




                              Name:                                                      Category:
                                                             psychology


                                                                    Lookup




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/Intro10.aspx [4/02/2002 8:52:55 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/Intro11.aspx




                                            Name:
                                            Category: <!--Select Category-->
                                                                   Lookup




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/Intro11.aspx [4/02/2002 8:52:56 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/Intro12.aspx




                                            Name:
                                            Category: <!--Select Category-->
                                                                   Lookup




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/Intro12.aspx [4/02/2002 8:52:57 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro13.aspx




                                            Name:
                                            Category: <!--Select Category-->
                                                                   Lookup




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/intro/VB/intro13.aspx [4/02/2002 8:52:58 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/controls/VB/controls1.aspx


Declaring Server Controls
This sample demonstrates how to declare the <asp:label> server control and manipulate its properties
within a page.



This is Message One
This is Message Two
This is Message Three




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/controls/VB/controls1.aspx [4/02/2002 8:52:58 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/controls/VB/controls2.aspx


Manipulating Server Controls
This sample demonstrates how to manipulate the <asp:label> server control within the Page_Load
event to output the current time.



You last accessed this page at: 2/3/2002
1:52:44 PM




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/controls/VB/controls2.aspx [4/02/2002 8:52:59 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/controls/VB/controls3.aspx


Handling Control Action Events
This sample demonstrates how to access a <asp:textbox> server control within the "Click" event of a
<asp:button>, and use its content to modify the text of a <asp:label>.



Please enter your name:                                                                 Enter




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/controls/VB/controls3.aspx [4/02/2002 8:52:59 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/controls/VB/controls4.aspx


Handling Multiple Control Action Events
This sample demonstrates how to handle multiple control action events raised from different
<asp:button> controls.


Available Fonts                                   Installed Fonts
 Roman                                             Times
 Arial Black                                       Helvetica
 Garamond                                          Arial
 Somona
 Symbol
                         <<      < >        >>




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/controls/VB/controls4.aspx [4/02/2002 8:53:00 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/controls/VB/controls5.aspx


Performing Page Navigation (Scenario 1)
This sample demonstrates how to generate a HTML Anchor tag that will cause the client to navigate
to a new page when he/she clicks it within the browser.




Hi Fred please click this link!




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/controls/VB/controls5.aspx [4/02/2002 8:53:01 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/controls/VB/controls6.aspx


Performing Page Navigation (Scenario 2)
This sample demonstrates how to navigate to a new page from within a <asp:button> click event,
passing a <asp:textbox> value as a querystring argument (validating first that the a legal textbox value
has been specified).



Please enter your name:                                                                 Enter




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/controls/VB/controls6.aspx [4/02/2002 8:53:01 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style1.aspx


Applying Styles to HTML Controls

Styled Span

This is some literal text inside a styled span control

Styled Button

Click me!


Styled Text Input

Enter some text:

One, Two, Three


Styled Select Input

Select an item:

Item 1


Styled Radio Buttons

Select an option:

    Option 1
    Option 2
    Option 3




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style1.aspx [4/02/2002 8:53:02 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style2.aspx


Applying Styles to HTML Controls

Styled Span

This is some literal text inside a styled span control

Styled Button

Click me!


Styled Text Input

Enter some text:

One, Two, Three


Styled Select Input

Select an item:

Item 1


Styled Radio Buttons

Select an option:

    Option 1
    Option 2
    Option 3




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style2.aspx [4/02/2002 8:53:02 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style3.aspx


Programmatically Accessing Styles
Accessing Styles...

The color of the span is: orange
The width of the textbox is: 300

MySelect's style collection is:
 font=14pt verdana
 background-color=lightblue
 color=purple

Select a color for the span:


red                 Change Style


Styled Span

This is some literal text inside a styled span control

Styled Button

Click me!


Styled Text Input

Enter some text:

One, Two, Three


Styled Select Input

Select an item:

Item 1


Styled Radio Buttons

Select an option:

    Option 1
    Option 2


 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style3.aspx (1 of 2) [4/02/2002 8:53:03 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style3.aspx


   Option 3




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style3.aspx (2 of 2) [4/02/2002 8:53:03 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style4.aspx


Applying Styles to Web Controls

Style Properties

No Style:

<                                                              February 2002                                                       >
      Sun                  Mon                   Tue                  Wed                        Thu             Fri         Sat
       27                  28                    29                   30                          31              1           2
        3                     4                    5                     6                        7              8           9
       10                    11                    12                   13                       14              15          16
       17                    18                    19                   20                       21              22          23
       24                    25                    26                   27                       28              1           2
        3                     4                    5                     6                        7              8           9

Style: (OK, maybe it's bad style, but at least I wear matching socks...)



 <                                            February 2002                                                  >



     Sun             Mon              Tue              Wed             Thu               Fri           Sat


      27              28               29               30              31                   1         2


       3               4                5                6               7                   8         9


      10              11               12               13              14               15            16


      17              18               19               20              21               22            23


      24              25               26               27              28                   1         2




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style4.aspx (1 of 2) [4/02/2002 8:53:04 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style4.aspx




      3               4                5                6               7                   8    9




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style4.aspx (2 of 2) [4/02/2002 8:53:04 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style5.aspx


Applying Styles to Web Controls

Style Sub-Properties



 <                                           February 2002                                            >


     Sun            Mon              Tue             Wed              Thu               Fri     Sat


     27              28               29               30              31                   1   2



      3               4                5                6               7                   8   9



     10              11               12               13              14               15      16



     17              18               19               20              21               22      23



     24              25               26               27              28                   1   2



      3               4                5                6               7                   8   9




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style5.aspx [4/02/2002 8:53:05 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style6.aspx


Applying Styles to Web Controls

Style Sub-Properties



 <                                           February 2002                                            >


     Sun            Mon              Tue             Wed              Thu               Fri     Sat


     27              28               29               30              31                   1   2



      3               4                5                6               7                   8   9



     10              11               12               13              14               15      16



     17              18               19               20              21               22      23



     24              25               26               27              28                   1   2



      3               4                5                6               7                   8   9




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style6.aspx [4/02/2002 8:53:06 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style7.aspx


Applying Styles to Web Controls

The CssClass Property



 <                                           February 2002                                            >


     Sun            Mon              Tue             Wed              Thu               Fri     Sat


     27              28               29               30              31                   1   2



      3               4                5                6               7                   8   9



     10              11               12               13              14               15      16



     17              18               19               20              21               22      23



     24              25               26               27              28                   1   2



      3               4                5                6               7                   8   9




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style7.aspx [4/02/2002 8:53:07 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style8.aspx


Applying Styles to Web Controls

Expando CSS Styles


  Login:

  Password:

  Select a View:                      Default Desktop


                                        Submit




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style8.aspx [4/02/2002 8:53:08 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style9.aspx


Applying Styles to Web Controls

Applying Styles Programmatically


  Login:

  Password:

  Select a View:                      Default Desktop


                                        Submit




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/customize/VB/style9.aspx [4/02/2002 8:53:08 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator1.aspx


Simple RequiredField Validator Sample

 Fill in the required fields below


 Credit Card Information


                                      MasterCard
         Card Type:
                                      Visa


    Card Number:


 Expiration Date:


                                    Validate




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator1.aspx [4/02/2002 8:53:09 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator2.aspx


Client-Side RequiredFieldValidator Sample

 Fill in the required fields below

 Credit Card Information


                                      MasterCard
         Card Type:                                                           *
                                      Visa


    Card Number:                                                              *


 Expiration Date:                                                             *


                                    Validate




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator2.aspx [4/02/2002 8:53:10 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator3.aspx


ValidationSummary Sample


     Credit Card Information


                                          MasterCard
             Card Type:
                                          Visa


        Card Number:


     Expiration Date:


                                        Validate



Select the type of validation summary display you wish: Bulleted List




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator3.aspx [4/02/2002 8:53:11 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator4.aspx


CompareValidator Example
Type a value in each textbox, select a comparison operator, then click "Validate" to test.


  String 1:                                   Comparison Operator:                          String 2:

                                               Equal
                                               NotEqual
                                               GreaterThan
                                               GreaterThanEqual                                 Validate
                                               LessThan




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator4.aspx [4/02/2002 8:53:11 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator5.aspx


RangeValidator Sample

 Value to Check:                             Data Type: Integer Min(1), Max(10)




 Value to Check:                             Data Type: Date Min(1/1/2000), Max(1/1/2001)




 Value to Check:                             Data Type: String Min(Aardvark), Max(Zebra)




 Validate




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator5.aspx [4/02/2002 8:53:12 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator6.aspx


Simple RegularExpressionValidator Sample

 Enter a 5 digit zip code


 Personal Information


 Zip Code:


                          Validate




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator6.aspx [4/02/2002 8:53:12 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator7.aspx


More Regular Expression Examples

 Enter values for each field


 Personal Information


      Email:


     Phone:


 Zip Code:


                          Validate




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator7.aspx [4/02/2002 8:53:13 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator8.aspx


CustomValidator Example
Enter an even number:




  Validate




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator8.aspx [4/02/2002 8:53:13 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator9.aspx


Sign In Form Validation Sample



Sign-In Information

           Email Address:

                  Password:

     Re-enter Password:


Personal Information

                First Name:

                Last Name:

                    Address:

                        State:                                          Zip Code:

                      Phone:


Credit Card Information

                                      MasterCard
                 Card Type:
                                      Visa
             Card Number:

          Expiration Date:


                                                                     Sign In




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/validate/VB/validator9.aspx [4/02/2002 8:53:14 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet1.aspx


A Simple User Control

This is a simple message user control!




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet1.aspx [4/02/2002 8:53:15 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet2.aspx


A Simple User Control w/ Properties

This is a custom message!

      Change Properties




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet2.aspx [4/02/2002 8:53:15 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet3.aspx


A Simple User Control w/ Properties

Shipping Address
Address:          One Microsoft Way

City:             Redmond                                    State:          WA       Zip:   98052


Billing Address
Address:
City:                                                        State:                   Zip:

  Submit Form




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet3.aspx [4/02/2002 8:53:16 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet4.aspx


A Login User Control


  Login:                       John Doe


  Password:

                                 Submit




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet4.aspx [4/02/2002 8:53:17 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet5.aspx


A Login User Control


  Login:

  Password:

                                 Submit




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet5.aspx [4/02/2002 8:53:17 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet6.aspx


A User Control w/ an Event

Select a Category:                       Business


                             Title: The Busy                                                     Title: You Can
                             Executive's Database                                                Combat Computer
                             Guide                                                               Stress!
                             Category: business                                                  Category:
                             Publisher ID: 1389                                                  business
                             Price: $ 19.99                                                      Publisher ID:
                                                                                                 0736
                                                                                                 Price: $ 2.99

                             Title: Cooking with                                                 Title: Straight Talk
                             Computers:                                                          About Computers
                             Surreptitious Balance                                               Category:
                             Sheets                                                              business
                             Category: business                                                  Publisher ID:
                             Publisher ID: 1389                                                  1389
                             Price: $ 11.95                                                      Price: $ 19.99




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet6.aspx [4/02/2002 8:53:19 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet7.aspx


Creating User Controls Programmatically


Category: business
                             Title: The Busy                                                      Title: You Can
                             Executive's Database                                                 Combat Computer
                             Guide                                                                Stress!
                             Category: business                                                   Category:
                             Publisher ID: 1389                                                   business
                             Price: $ 19.99                                                       Publisher ID:
                                                                                                  0736
                                                                                                  Price: $ 2.99

                             Title: Cooking with                                                  Title: Straight Talk
                             Computers:                                                           About Computers
                             Surreptitious Balance                                                Category:
                             Sheets                                                               business
                             Category: business                                                   Publisher ID:
                             Publisher ID: 1389                                                   1389
                             Price: $ 11.95                                                       Price: $ 19.99



Category: trad_cook
                             Title: Onions, Leeks,                                                  Title: Sushi,
                             and Garlic: Cooking                                                    Anyone?
                             Secrets of the                                                         Category:
                             Mediterranean                                                          trad_cook
                             Category: trad_cook                                                    Publisher ID:
                             Publisher ID: 0877                                                     0877
                             Price: $ 20.95                                                         Price: $ 14.99




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet7.aspx (1 of 2) [4/02/2002 8:53:20 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet7.aspx



                             Title: Fifty Years in
                             Buckingham Palace
                             Kitchens
                             Category: trad_cook
                             Publisher ID: 0877
                             Price: $ 11.95




Category: mod_cook
                             Title: Silicon Valley                                                Title: The Gourmet
                             Gastronomic Treats                                                   Microwave
                             Category: mod_cook                                                   Category:
                             Publisher ID: 0877                                                   mod_cook
                             Price: $ 19.99                                                       Publisher ID:
                                                                                                  0877
                                                                                                  Price: $ 2.99




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/pagelets/VB/Pagelet7.aspx (2 of 2) [4/02/2002 8:53:20 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind1.aspx


DataBinding to a Property on the Page
Customer: ALFKI
Open Orders: 11




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind1.aspx [4/02/2002 8:53:21 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind2.aspx


DataBinding to a property of another server control

CA           Submit


Selected State:




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind2.aspx [4/02/2002 8:53:21 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind3.aspx


DataBinding DropDownList

IN          Submit




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind3.aspx [4/02/2002 8:53:22 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind4.aspx


Databinding to a DataView

IntegerValue StringValue DateTimeValue                                  BooleanValue
1                   Item 1             2/3/2002 1:53:00 PM True
2                   Item 2             2/3/2002 1:53:00 PM False
3                   Item 3             2/3/2002 1:53:00 PM True
4                   Item 4             2/3/2002 1:53:00 PM False
5                   Item 5             2/3/2002 1:53:00 PM True
6                   Item 6             2/3/2002 1:53:00 PM False
7                   Item 7             2/3/2002 1:53:00 PM True
8                   Item 8             2/3/2002 1:53:00 PM False
9                   Item 9             2/3/2002 1:53:00 PM True




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind4.aspx [4/02/2002 8:53:23 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind5.aspx


DataBinding to a Hashtable

key1 : value1
key3 : value3
key2 : value2




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind5.aspx [4/02/2002 8:53:23 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind6.aspx


Databinding to Methods and Expressions

Number Value: 0 Even/Odd: Even
Number Value: 1 Even/Odd: Odd
Number Value: 2 Even/Odd: Even
Number Value: 3 Even/Odd: Odd
Number Value: 4 Even/Odd: Even
Number Value: 5 Even/Odd: Odd
Number Value: 6 Even/Odd: Even




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind6.aspx [4/02/2002 8:53:24 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind7.aspx


Databinding Using DataBinder.Eval

Order Date: 2/3/2002                  Order Date: 2/3/2002                   Order Date: 2/3/2002

Quantity: 0.00                        Quantity: 3.00                         Quantity: 6.00

Item: Item 0 Order Date: Item: Item 3 Order Date: Item: Item 6 Order Date:



Order Date: 2/3/2002                  Order Date: 2/3/2002                   Order Date: 2/3/2002

Quantity: 1.00                        Quantity: 4.00                         Quantity: 7.00

Item: Item 1 Order Date: Item: Item 4 Order Date: Item: Item 7 Order Date:



Order Date: 2/3/2002                  Order Date: 2/3/2002                   Order Date: 2/3/2002

Quantity: 2.00                        Quantity: 5.00                         Quantity: 8.00

Item: Item 2 Order Date: Item: Item 5 Order Date: Item: Item 8 Order Date:




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/DataBind/VB/DataBind7.aspx [4/02/2002 8:53:24 AM]
 Microsoft ASP.NET QuickStarts Tutorial

Getting Started                    ADO.NET Overview
 Introduction
 What is ASP.NET?                  ADO.NET is an evolution of the ADO data access model that directly addresses user requirements for developing scalable applications.
                                   It was designed specifically for the web with scalability, statelessness, and XML in mind.
 Language Support

                                   ADO.NET uses some ADO objects, such as the Connection and Command objects, and also introduces new objects. Key new
ASP.NET Web Forms                  ADO.NET objects include the DataSet, DataReader, and DataAdapter.
 Introducing Web Forms
 Working with Server Controls      The important distinction between this evolved stage of ADO.NET and previous data architectures is that there exists an object -- the
 Applying Styles to Controls       DataSet -- that is separate and distinct from any data stores. Because of that, the DataSet functions as a standalone entity. You can
                                   think of the DataSet as an always disconnected recordset that knows nothing about the source or destination of the data it contains.
 Server Control Form Validation
                                   Inside a DataSet, much like in a database, there are tables, columns, relationships, constraints, views, and so forth.
 Web Forms User Controls
 Data Binding Server Controls
                                   A DataAdapter is the object that connects to the database to fill the DataSet. Then, it connects back to the database to update the
 Server-Side Data Access           data there, based on operations performed while the DataSet held the data. In the past, data processing has been primarily
 Data Access and Customization     connection-based. Now, in an effort to make multi-tiered apps more efficient, data processing is turning to a message-based approach
                                   that revolves around chunks of information. At the center of this approach is the DataAdapter, which provides a bridge to retrieve
 Working with Business Objects
                                   and save data between a DataSet and its source data store. It accomplishes this by means of requests to the appropriate SQL
 Authoring Custom Controls         commands made against the data store.
 Web Forms Controls Reference
 Web Forms Syntax Reference        The XML-based DataSet object provides a consistent programming model that works with all models of data storage: flat, relational,
                                   and hierarchical. It does this by having no 'knowledge' of the source of its data, and by representing the data that it holds as
                                   collections and data types. No matter what the source of the data within the DataSet is, it is manipulated through the same set of
ASP.NET Web Services               standard APIs exposed through the DataSet and its subordinate objects.
 Introducing Web Services
 Writing a Simple Web Service      While the DataSet has no knowledge of the source of its data, the managed provider has detailed and specific information. The role of
 Web Service Type Marshalling      the managed provider is to connect, fill, and persist the DataSet to and from data stores. The OLE DB and SQL Server .NET Data
                                   Providers (System.Data.OleDb and System.Data.SqlClient) that are part of the .Net Framework provide four basic objects: the
 Using Data in Web Services
                                   Command, Connection, DataReader and DataAdapter. In the remaining sections of this document, we'll walk through each part
 Using Objects and Intrinsics      of the DataSet and the OLEDB/SQL .NET Data Providers explaining what they are, and how to program against them.
 The WebService Behavior
 HTML Pattern Matching             The following sections will introduce you to some objects that have evolved, and some that are new. These objects are:


ASP.NET Web Applications                  q   Connections. For connection to and managing transactions against a database.
                                              Commands. For issuing SQL commands against a database.
 Application Overview
                                          q

                                          q   DataReaders. For reading a forward-only stream of data records from a SQL Server data source.
 Using the Global.asax File               q   DataSets. For storing, remoting and programming against flat data, XML data and relational data.
 Managing Application State               q   DataAdapters. For pushing data into a DataSet, and reconciling data against a database.
 HttpHandlers and Factories
                                              Note When dealing with connections to a database, there are two different options: ADO.NET SQL Data Provider
                                              (System.Data.SqlClient) and ADO.NET OLE DB Data Provider (System.Data.OleDb). In these samples we will use the
Cache Services                                ADO.NET SQL Data Provider. These are written to talk directly to Microsoft SQL Server. The ADO.NET OLE DB Data
 Caching Overview                             Provider is used to talk to any OLE DB provider (as it uses OLEDB underneath).
 Page Output Caching
 Page Fragment Caching             Connections
 Page Data Caching
                                   Connections are used to 'talk to' databases, and are respresented by provider-specific classes such as SQLConnection. Commands
                                   travel over connections and resultsets are returned in the form of streams which can be read by a DataReader object, or pushed into
Configuration                      a DataSet object.
 Configuration Overview
 Configuration File Format
                                   The example below shows how to create a connection object. Connections can be opened explicitly by calling the Open method on the
 Retrieving Configuration          connection, or will be opened implicitly when using a DataAdapter.


Deployment                                                                      LateBreaking Samples:
 Deploying Applications                                                         q C++
 Using the Process Model
 Handling Errors


Security                                      VB AdoOverview1.aspx
 Security Overview
 Authentication & Authorization           [Run Sample] | [View Source]
 Windows-based Authentication
 Forms-based Authentication        Commands
 Authorizing Users and Roles
 User Account Impersonation        Commands contain the information that is submitted to a database, and are represented by provider-specific classes such as
 Security and WebServices          SQLCommand. A command can be a stored procedure call, an UPDATE statement, or a statement that returns results. You can also
                                   use input and output parameters, and return values as part of your command syntax. The example below shows how to issue an
                                   INSERT statement against the Northwind database.
Localization
 Internationalization Overview
 Setting Culture and Encoding
 Localizing ASP.NET Applications
 Working with Resource Files


Tracing
 Tracing Overview
 Trace Logging to Page Output


 http://samples.gotdotnet.com/quickstart/aspplus/doc/adoplusoverview.aspx (1 of 3) [4/02/2002 8:53:27 AM]
 Microsoft ASP.NET QuickStarts Tutorial

 Application-level Trace Logging


Debugging
 The SDK Debugger


Performance                               VB AdoOverview2.aspx
 Performance Overview
 Performance Tuning Tips                  [Run Sample] | [View Source]
 Measuring Performance
                                   DataReaders
ASP to ASP.NET Migration
 Migration Overview                The DataReader object is somewhat synonymous with a read-only/forward-only cursor over data. The DataReader API supports flat
 Syntax and Semantics              as well as hierarchical data. A DataReader object is returned after executing a command against a database. The format of the
                                   returned DataReader object is different from a recordset.For example, you might use the DataReader to show the results of a
 Language Compatibility            search list in a web page.
 COM Interoperability
 Transactions


Sample Applications
 A Personalized Portal
 An E-Commerce Storefront
 A Class Browser Application              VB AdoOverview3.aspx
 IBuySpy.com
                                          [Run Sample] | [View Source]
Get URL for this page

                                   DataSets and DataAdapters

                                   DataSets
                                   The DataSet object is similar to the ADO Recordset object, but more powerful, and with one other important distinction: the
                                   DataSet is always disconnected. The DataSet object represents a cache of data, with database-like structures such as tables,
                                   columns, relationships, and constraints. However, though a DataSet can and does behave much like a database, it is important to
                                   remember that DataSet objects do not interact directly with databases, or other source data. This allows the developer to work with a
                                   programming model that is always consistent, regardless of where the source data resides. Data coming from a database, an XML file,
                                   from code, or user input can all be placed into DataSet objects. Then, as changes are made to the DataSet they can be tracked and
                                   verified before updating the source data. The GetChanges method of the DataSet object actually creates a second DatSet that
                                   contains only the changes to the data. This DataSet is then used by a DataAdapter (or other objects) to update the original data
                                   source.


                                   The DataSet has many XML characteristics, including the ability to produce and consume XML data and XML schemas. XML schemas
                                   can be used to describe schemas interchanged via WebServices. In fact, a DataSet with a schema can actually be compiled for type
                                   safety and statement completion.


                                   DataAdapters (OLEDB/SQL)
                                   The DataAdapter object works as a bridge between the DataSet and the source data. Using the provider-specific SqlDataAdapter
                                   (along with its associated SqlCommand and SqlConnection) can increase overall performance when working with a Microsoft SQL
                                   Server databases. For other OLE DB-supported databases, you would use the OleDbDataAdapter object and its associated
                                   OleDbCommand and OleDbConnection objects.


                                   The DataAdapter object uses commands to update the data source after changes have been made to the DataSet. Using the Fill
                                   method of the DataAdapter calls the SELECT command; using the Update method calls the INSERT, UPDATE or DELETE command
                                   for each changed row. You can explicitly set these commands in order to control the statements used at runtime to resolve changes,
                                   including the use of stored procedures. For ad-hoc scenarios, a CommandBuilder object can generate these at run-time based upon
                                   a select statement. However, this run-time generation requires an extra round-trip to the server in order to gather required metadata,
                                   so explicitly providing the INSERT, UPDATE, and DELETE commands at design time will result in better run-time performance.



                                        ' Warning: Embedded usernames/passwords in database connection strings are inherently
                                        ' insecure, and should only be used on platforms (e.g. Win9x) that do not support Integrated
                                        ' Security. See the ASP.NET Quickstart for examples of Integrated Security.
                                        Dim myConnection As SqlConnection = New
                                        SqlConnection("server=(local)\NetSDK;uid=QSUser;pwd=QSPassword;database=northwind")
                                        Dim mySqlDataAdapter As SqlDataAdapter = New SqlDataAdapter("select * from customers", myConnection)

                                        mySqlDataAdapter.InsertCommand.CommandText                =   "sp_InsertCustomer"
                                        mySqlDataAdapter.InsertCommand.CommandType                =   CommandType.StoredProcedure
                                        mySqlDataAdapter.DeleteCommand.CommandText                =   "sp_DeleteCustomer"
                                        mySqlDataAdapter.DeleteCommand.CommandType                =   CommandType.StoredProcedure
                                        mySqlDataAdapter.UpdateCommand.CommandText                =   "sp_UpdateCustomers"
                                        mySqlDataAdapter.UpdateCommand.CommandType                =   CommandType.StoredProcedure


                                   VB



                                        mySqlDataAdapter.Update(myDataSet)


                                   VB


                                   The records are appropriately mapped to the given commands accordingly.



 http://samples.gotdotnet.com/quickstart/aspplus/doc/adoplusoverview.aspx (2 of 3) [4/02/2002 8:53:27 AM]
Microsoft ASP.NET QuickStarts Tutorial




                                 Figure: DataAdapters and DataSets

                                 The sample below illustrates loading a DataAdapter via a SELECT statement. Then it updates, deletes and adds some records within
                                 the DataSet. Finally, it returns those updates to the source database via the DataAdapter. The constructed DeleteCommand,
                                 InsertCommand and UpdateCommand are shown in the page. It also illustrates using multiple DataAdapter objects to load multiple
                                 tables (Customers and Orders) into the DataSet.




                                         VB AdoOverview4.aspx

                                         [Run Sample] | [View Source]


                                 Section Summary

                                      1. ADO.NET is the next evolution of ADO for the .Net Framework.
                                      2. ADO.NET was created with n-Tier, statelessness and XML in the forefront. Two new objects, the DataSet and DataAdapter,
                                         are provided for these scenarios.
                                      3. ADO.NET can be used to get data from a stream, or to store data in a cache for updates.
                                      4. There is a lot more information about ADO.NET in the documentation.
                                      5. Remember, you can execute a command directly against the database in order to do inserts, updates, and deletes. You don't
                                         need to first put data into a DataSet in order to insert, update, or delete it.
                                      6. Also, you can use a DataSet to bind to the data, move through the data, and navigate data relationships.



                                                                      Copyright 2001 Microsoft Corporation. All rights reserved.




http://samples.gotdotnet.com/quickstart/aspplus/doc/adoplusoverview.aspx (3 of 3) [4/02/2002 8:53:27 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

Simple Select to a DataGrid Control

au_id au_lname            au_fname                  phone             address                 city                 state zip      contract
000-
00-    ana                Takeit                    100 111-2333      1937 17th Ave           Chuckle City         TN       63841 False
0000
000-
00-    Yozzav             phil                      100 111-2222      Sixtengatan 16          shenzhen             IN       51802 False
0001
000-
00-    Dear               John                      310 777-8375      123 No Way              Smallville           UT       34523 True
0002
000-
00-    MMM                GoodKKKK                  800 123-4569      Ext Way 123             •stanbul             MO       80300 False
0003
000-
00-    Shit               Maggie'sTeensfa           905 555-5544      123 Main street         Mississaugadf        KS       12345 False
0004
000-
00-    Nisse              Pettersson                123 456-7890      jularbovägen            Stockholm            MD       12345 True
0005
000-
00-    Key                Cindy Cla                 858 555-1212      One San Diego Way 268   244 B IUH IPU        OR       92139 False
0006
000-
00-    XT                 xiangTest                 888 859-7845      12345 Hehaw             Vermont              TN       98005 True
0007
000-
00-    Hakan              Erens                     216 342-1111      Uskudar                 Istanbul             MD       11111 False
0008
000-
00-    Hertz              Jezebel                   808 555-5555      17 Instant Oats Ct      Benjaminia           IN       98005 True
0009
000-
00-    REK                Real Estate King          808 555-5555      Nutscrape Sucks!!       Redmond              KS       98005 False
0010
000-
00-    Heikkinen          Kimmo                     808 555-5555      Finland                 Espoo                TN       98005 False
0011
000-
00-    Heray              Cuisn                     5555555555        Dead Java Way           Jan Mayen            OR       98005 False
0012
000-
00-    Hughee             Mikee                     808 555-5555      One Microsoft Way       Redmond              CA       12345 False
0013
000-
00-    maxsun             pittman1                  305 237-3000      VB Net Wiz              Miami                IN       33132 False
0014
000-
00-    Changc             Zork                      808 555-5555      On My Way               Redmond              CA       98005 False
0015
000-
00-    Hakan              Eren                      216 342-1111      Uskudar                 Mt. Hood             OR       95432 True
0016
000-
00-    efwef33333         Jebo z Lesa               123 435-4356      Smetiar 33              Bratislava           CA       81000 False
0017
000-
00-    pippo              pluto                     293849832         no way23                tel-aviv23           CA       98005 False
0018

000-
00-    amparoklp          amarosa                   808 555-5555      One Microsoft Way       Redmond              IN       98005 True
0019




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (1 of 36) [4/02/2002 8:54:07 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
00-    Morrison           Skot                      808 555-5551      One Microsoft Way        Redmond             CA       98005 False
0020

000-
00-    The Ripper         Jack                      808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0021
000-
00-    Rogériod test      Sampaio                   808 555-5555      One Microsoft Way        Redmond             CA       98005 True
0022
000-
00-    Arsen              Jack                      808 555-5555      One Microsoft Wa         Redmond             CA       98005 False
0023
000-
00-    Doe                Carlo                     808 555-5555      One Microsoft Way        Redmond             xx       98005 False
0024
000-
00-    Doaks              Joe                       808 555-5553      One Microsoft Way        Redmond             CA       98052 False
0025
000-
00-    Alexio             Knight                    808 555-5555      churchill street         Montreal            CA       98005 False
0026
000-
00-    RAZ                Fazfaz                    111 111-1111      Apple Computer           L.A.                OR       99099 True
0027
000-
00-    Caipang            Nelgraine                 032 2340119       Cebu City, Philippines   Cebu City           CA       98005 True
0028
000-
00-    Ramsha             RD                        091 4255-552      Great Indian             Coimbatore          TN       64100 True
0029
000-
00-    Hu                 Yu                        123 123-1234      One Microsoft Way        Redmond             IN       98005 False
0030
000-
00-    qwrwq              Max                       808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0031
000-
00-    Tester             Theory                    808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0032
000-
00-    Ram                Ram                       846 676-5555      Indian Gate Way          CBE                 TN       64100 False
0033

000-
00-    Wadd               Johnny                    702 555-5555      One Paradise Blvd        Las Vegas           NV       89121 False
0034
000-
00-    The Clown          Homey                     554 444-1232      Circus                   Hell                CA       33243 True
0035
000-
00-    Kansas City        Is a Mighty Pretty        But it Aint       Got What                 I got               ks       98005 False
0036
000-
00-    Does Dallas        Harry                     808 555-5555      One Microsoft Way        Redmond             KS       98005 False
0037
000-
00-    Titi               Toto                      808 555-5555      One Microsoft Way        Paris               IN       75000 True
0038
000-
00-    Dokes              Jeremy                    808 555-5555      One Microsoft Way        Redmond             CA       98005 True
0039
000-
00-    Lowe               Alex                      808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0040
000-
00-    Doe                John                      808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0041




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (2 of 36) [4/02/2002 8:54:07 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
00-    Carlson            Mike                      808 555-5555      One Microsoft Way            Redmond            CA    98005 False
0042
000-
                                                                      2011 Palomar Airport Road,
00-    Riad               Craig                     760 496-0200                                   Carlsbad           CA    92009 True
                                                                      Suite 200
0043
000-
00-    Doeremi            Johnny                    808 555-5555      One Microsoft Way            Redmond            KS    98005 True
0044
000-
00-    Jamie              Washere                   808 555-5555      axaxaxaxaxaxax               axaxaxaxaxaxaxaxa CA     98005 False
0045
000-
00-    Doe                John                      808 555-5555      One Microsoft Way            Redmond            CA    98005 True
0046
000-
00-    This .Net is       the best ever!            808 555-5555      One Way                      Redmond            CA    98005 False
0047
000-
       Hey, Jen it's
00-                       Cool eh?                  808 555-5555      Let's Party!!!!              Downtown!          CA    98005 False
       Friiiiday!
0048
000-
       Bjorn is the
00-                       CRAAAAAAAA                808 555-5555      Bow chicka bow wow!          Chicka bow         CA    98005 False
       man!
0049
000-
00-    Bjorn has 12!      Think about it! TWEL      808 555-5555      Bow chicka bow wow Bjorn!    Redmond            CA    98005 False
0050
000-
00-    Kaushik            fefdssfd                  808 555-5555      One Microsoft Way            Redmond            CA    98005 False
0051
000-
00-    olivier            ppol                      808 555-5555      One Microsoft Way            rftyuerter         CA    98006 False
0052
000-
00-    Dias dos Santos    Leonardossss              808 555-5554      One Microsoft Way            Redmond            CA    98005 False
0053
000-
00-    Hockey             Rocks                     808 555-5555      One Microsoft Way            Redmond            CA    98005 False
0054
000-
00-    PIZZA PARTY!       PIZZA PARTY!              808 555-5555      Kabul                        Redmond            MI    98005 False
0055
000-
00-    Test               Jack                      808 555-5555      One Microsoft Way            Redmond            CA    98005 False
0056
000-
       Gingerbread
00-                       pizza party!              808 555-5555      You hava coupons?            GIMME NOW!!!       CA    98005 False
       Ratte!
0057

000-
00-    Jen Has some!      Bow chicka Jen!           808 555-5555      hahahahha, im a prude!       no music for me!   CA    98005 False
0058
000-
00-    NERD!              ALERT!                    808 555-5555      Right here, on               THIS PAGE!!!!      CA    98005 False
0059
000-
00-    Hansen             Jack                      808 555-5555      One Microsoft Way            Redmond            OR    98005 False
0060
000-
00-    Albright           Chris                     808 555-5555      One Microsoft Way            Redmond            CA    98005 False
0061
000-
00-    Nat                Dune                      808 555-5555      One Microsoft Way            Redmond            CA    98005 False
0062
000-
00-    Doe                John                      808 555-5555      One Microsoft Way            Redmond            CA    98005 False
0065




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (3 of 36) [4/02/2002 8:54:07 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
00-    voytek             dj                        808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0066
000-
00-    Doe                jjjjjjj                   808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0067
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0069
000-
00-    Johnson            Martin                    808 222-1234      Java memorial way        Cochin, India       CA       08873 False
0070
000-
00-    Doe                Alex                      808 555-5555      One Microsoft Way        Redmond             CA       98005 True
0071
000-
00-    Flintstone         Fred                      808 555-5555      South Africa             Pretoria            TN       98005 False
0072
000-
00-    Does               Elaine                    808 555-5555      1445 Alpina St           Salina              KS       63004 False
0077
000-
00-    doe                John                      808 555-5555      One Microsoft WrongWay   Redmond             CA       98009 False
0078
000-
00-    Doe                John                      808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0079
000-
00-    Issa               Mohammed                  808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0080
000-
00-    Doe                Raghavan                  808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0082
000-
00-    Doe                John                      808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0085
000-
00-    ak1                ak1                       808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0088
000-
00-    Golh               John                      808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0089
000-
00-    Doe                John                      808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0090
000-
00-    Doe                John                      808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0091
000-
00-    Doe                John                      808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0092
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0098
000-
00-    Doe                juuu                      808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0099
000-
00-    geff               blatt                     808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0100
000-
00-    Doe                John                      808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0101
000-
00-    Murad              Kayani                    808 555-5555      One Microsoft Way        Redmond             CA       98005 False
0110




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (4 of 36) [4/02/2002 8:54:07 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
00-    Rus                Tome                      808 555-5555      My Way                  Redmond              CA       98005 False
0111

000-
00-    Cheng              Henry                     808 555-5555      One Microsoft Way       Redmond              IN       98005 True
0112
000-
00-    Doe                Aaron                     808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0120
000-
00-    l                  abcdefg                   808 555-5555      One                     Redmond              CA       98005 False
0121
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0122
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0123
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0125
000-
00-    pp                 pp                        808 555-5555      pp                      pp                   OR       98005 False
0147
000-
00-    •                  •                         808 555-5555      CRAZYINSUN              CRAZYINSUN           CA       20013 False
0170
000-
00-    ••                 •                         808 555-5555      CRAZYINSUN              CRAZYINSUN           CA       20001 True
0180
000-
00-    Walker             Glenn                     808 555-5555      One Microsoft Way       Redmond              CA       98005 True
0199
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0201
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0232
000-
00-    Aoki               Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0300

000-
00-    456Doe             Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0325
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0333
000-
00-    Doe                Jefferson                 808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0350
000-
00-    Venkaesh           Prasad                    808 555-5555      13131310                Hawthorne            CA       98005 False
0399
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0400
000-
00-    Cheney             Richard                   808 555-5555      Executive Building      Washington           CA       98005 True
0433
000-
00-    Rajesh1            krishna                   808 555-5555      Great Indian Desert     southport            CA       56003 False
0435
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0444




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (5 of 36) [4/02/2002 8:54:07 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0456

000-
00-    Doe                Head                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0483
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0500
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0540
000-
00-    34543              Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0545
000-
00-    Doe                Joe                       808 555-5555      Two Microsoft Way       Redmond              OR       98111 True
0550
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0567
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0578
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              IN       98005 False
0655
000-
00-    Eriko              Hidalgo                   808 555-5555      Fuck Taliban            Redmond              CA       98005 False
0666
000-
00-    V                  T                         555-555-5555      TEST                    TEST                 IN       98005 True
0678
000-
00-    aaron              aaron                     808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0690
000-
00-    donald             John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0708
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 True
0765

000-
00-    Anantha            Ram                       123-563-9800      Indian                  Hyderbad             CA       56003 False
0766
000-
00-    Lionel             Aaaaaa                    808 555-5555      Ahhhh                   Redmond              CA       98005 False
0777
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0789
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0800
000-
00-    Doe                John                      808 555-5555      old man's way           Redmond              CA       98005 False
0898
000-
00-    aabb               aabb                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
0987
000-
00-    al Turabi          Devil-Man                 808 555-5555      Slaughter-him-now       Khartoum             MD       98005 True
0999
000-
00-    moran              juliet                    808 555-5555      One Microsoft Way       Redmond              MD       98005 False
1000




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (6 of 36) [4/02/2002 8:54:07 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
00-    pasupuleti         prashant                  40993993290       One Microsoft Way       Redmond              UT       98005 True
1001

000-
00-    Ko                 eeeee                     808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1002
000-
00-    John               Capsher                   808 555-5555      weeeeeee                C-town               TX       98005 False
1003
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1004
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1005
000-
00-    Rew                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1008
000-
00-    Doe2               John Black                808 555-5555      One Microsoft Way       Redmond              CA       98005 True
1110
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1111
000-
00-    Cox                Nobbie                    123 456-7676      One Nobby way hey       Nobbieville          MI       99999 True
1112
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1116
000-
00-    Public             Joe                       123-445-3333      One Microsoft Way       Redmond              CA       98005 False
1119
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1176
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1212
000-
00-    Arthur             Weng                      808 555-5555      One Microsoft Way       Redmond              OR       98005 False
1233

000-
00-    Hanzitest          Hansen                    808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1234
000-
00-    Byoungho           Park                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1237
000-
00-    Doe2Doe            Johnny                    808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1245
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              OR       98005 False
1255
000-
00-    fred               fred                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1258
000-
00-    Long               HeeHaaw                   808 555-5342      Hard Way                Purple Head          CA       98005 False
1324
000-
00-    Tian               Leo                       777-777-7777      One Microsoft Way       Redmond              UT       98005 True
1394
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1500




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (7 of 36) [4/02/2002 8:54:08 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1602

000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1700
000-
00-    ZZZZZZ             ZZZZZZ                    808 555-5555      One Microsoft Way       Redmond              UT       98005 False
1972
000-
00-    Doe                Zhang                     808 555-5555      One Microsoft Way       Redmond              CA       98005 False
1973
000-
00-    Brown              Christian                 3000 0000         Tha knnkl               Redmondnklkn         CA       98005 False
1984
000-
00-    Pdfdsf             Laudfds                   808 555-5555      23, rue de Rans         Fraisans             CA       39700 False
1999
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
2000
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
2121
000-
00-    Kokulan            Ratnasngi                 808 555-5555      One Microsoft Way       Redmond              CA       98005 False
2154
000-
00-    Doe                John                                        One Microsoft Way       Redmond              CA       98005 False
2222
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
2223
000-
00-    zzzzzzzzzzzzzzz    John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
2274
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
2323
000-
00-    car                Kara                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
2324

000-
00-    Doe                Per                       808 555-5559      One Microsoft Way       Redmond              CA       98009 True
2555
000-
00-    Vladovsky          John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
2678
000-
00-    Beccar Varela      Marcos                    011 772-1839      One Microsoft Way       Buenos Aires         KS       14263 False
2728
000-
00-    3232               John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
2929
000-
00-    Devan              Divine                    717-000-0000      100 Divine Devan Ave.   Cedar Crest          CA       17005 True
3070
000-
00-    Tallada            Pau                       808 555-5555      Petit                   IPC                  PC       98005 True
3071
000-
00-    Doeddd             John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
3243
000-
00-    dddd               John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
3245




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (8 of 36) [4/02/2002 8:54:08 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
00-    wowza              wow                       808 555-5555      here                    Redmond              CA       98005 True
3322
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
3333
000-
00-    b                  abeer                     808 555-5555      mof                     Redmond              CA       98005 False
3635
000-
00-    Willie             Slick                     808 555-5555      One Microsoft Way       Redmond              IN       98005 False
3985
000-
00-    jain               rajni(My Dolly)           808 555-5555      One Microsoft Way       Redmond              CA       98005 False
4000
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
4001
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              MD       98005 True
4005
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
4200
000-
00-    Uplny              Jebo z Lesa               123 435-4356      Smetiar 32              Bratislava           CA       81000 False
4325
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
4344
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
4345
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
4352
000-
00-    Doe                Jack&Jill                 808 555-5555      One Microsoft Way       Redmond              CA       98005 False
4444
000-
00-    Ericson            Sven-Gøran                666 444-3333      1 Wembley Way           London               KS       98005 True
4544
000-
00-    Reynolds           Jim                       808 555-5555      One Oracle Way          Euston               CA       98005 True
4545
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
4546
000-
00-    Baggosdcsdfsdf     Juju                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
4567
000-
00-    Mama               Yo                        808 555-5555      One Microsoft Way       Redmond              UT       98005 False
4959
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
4999
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
5000
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA       98005 False
5555
000-
00-    Doe                Cret                      808 555-5555      One Microsoft Way       Redmond              CA       98005 True
6512




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (9 of 36) [4/02/2002 8:54:08 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6542

000-
00-    Man                Monkey                    808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6543
000-
00-    Peters             sdafgsdagdasg             808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6544
000-
00-    Bauers             Angies                    808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6548
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6564
000-
00-    XXXXX              XXXXX                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6578
000-
00-    Hi                 Hi                        805 222 222       Hello                   Redmond              KS    98005 False
6600
000-
00-    Rige               John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6615
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6656
000-
00-    Doexs'             Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6666
000-
00-    Doe                Blake                     808 555-5555      One Microsoft Way       Redmond              MD    98005 False
6676
000-
00-    Chaba              Steve                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6969
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6999
000-
00-    R                  Kim                       808 555-7474      One Microsoft Way       Redmond              MI    98005 False
7474

000-
00-    Doe5               John5                     808 555-5555      One Microsoft Way       Redmond              CA    98005 True
7532
000-
00-    abab               baba                      808 555-5555      asdfasdfs               Redmond              IN    98005 False
7676
000-
00-    Tester             Beta                      555 555-5555      By The River            Toborville           TN    07734 False
7734
000-
00-    c                  dgfdgdgt                  808 555-5555      One Microsoft Way       Redmond              KS    98005 False
7777
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
7858
000-
00-    Doe111             John1111                  111 555-5555      111111                  1111                 IN    11111 False
8524
000-
00-    dfghdfgh           dfghdfgh                  dfghdfgh          One Microsoft Way       Redmond              CA    98005 True
8528
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8550




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (10 of 36) [4/02/2002 8:54:08 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
00-    tekinn             cih                       808 555-5555      One Microsoft Way       Redmond              KS    98005 False
8564

000-
00-    Tester             Theo                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8756
000-
00-    jay                jjj                       808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8765
000-
00-    Tilla              Billa                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8884
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8888
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8976
000-
00-    Meay               Ohii                      956 268-7988      Gere                    ••                   MD    98953 True
8999
000-
00-    Lin                F.J.                      808 555-5555      One Microsoft Way       Redmond              MI    98005 False
9000
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9090
000-
00-    Doe2               John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9111
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9123
000-
00-    Meoff              Jack                      808 999-2022      Hey Now                 Redmond              CA    98005 False
9191
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9229
000-
00-    KKKKKKKK           KKKKKKKK                  808 555-5555      One Microsoft Way       Redmond              CA    98005 True
9281

000-
00-    pippobhjbjh        ddrtdtrdtrdtrdrtd         808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9568
000-
00-    Doeuww             Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9751
000-
00-    Testing            Insert                    808 555-5555      555 Test St.            Redmond              IN    98005 True
9874
000-
00-    sss33              John                      808 922-8827      Way                     322                  CA    98005 False
9878
000-
00-    Ivan               Ivanov                    808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9900
000-
00-    pasupuleti         lavanya                   808 555-5553      One Microsoft Way       Redmond              IN    98005 False
9902
000-
00-    Doer               Jonathan                  808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9909
000-
00-    asasasasasas       Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9926




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (11 of 36) [4/02/2002 8:54:08 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
00-    Makoto             Ishida                    808 922877        One Microsoft Way       Redmond              CA    98005 False
9932
000-
00-    Mike               This is greate!           808 922877        Honolulu                HI                   CA    98005 False
9933
000-
00-    Gavnov             Ivan                      858 555-5555      Two Macrohard No-Way    Pinkmond             CA    92019 True
9944
000-
00-    Gonna Be Die'n     Osama                     808 555-5555      Cave 86                 Effenstan            CA    86868 True
9956
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmon               CA    98005 False
9990
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9991
000-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              MD    98005 True
9993
000-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9999
000-
01-    Yu                 Kevin                     780 987-8611      No Microsoft Way        Redmond              CA    98005 True
0000
000-
01-    aydemir            bulent                    542 250-6034      www.101nokta.com        •stanbul             TN    80286 False
0001
000-
01-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1000
000-
01-    Cai                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1111
000-
01-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1222
000-
01-    Pump               Bilge                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1234
000-
01-    Pienescu           Bogdan                    808 555-5555      One Microsoft Way       Bucuresti            se    98005 False
1974
000-
01-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
2000
000-
01-    ddd                Bon Bon                   808 555-5555      One Microsoft Way       Redmond              CA    98005 False
2222
000-
01-    ALLAN              BALLAN                    808 555-5555      One Microsoft Way       Redmond              CA    98005 True
9999
000-
02-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
000-
05-    Doewq              John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0001
000-
07-    Boop               Betty                     808 555-5555      One Microsoft Way       Redmond              CA    98005 True
0000
000-
08-    Doe                Johnyuyu                  808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (12 of 36) [4/02/2002 8:54:08 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
09-    Lon                Bu                        808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
000-
09-    Mike               Lazius                    808 555-5555      One Microsoft Way       Redmond              CA    98005 True
9834
000-
10-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
000-
10-    Bwen               Gwendon                   123               Testing                 Kansas               KS    10000 False
0009
000-
10-    los                hji                       808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1546
000-
10-    qwq                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9999
000-
11-    aaaaa              John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
000-
11-    Doery              John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0001
000-
11-    KKKKK              PPPPPP                    808 555-5555      One Microsoft Way       Redmond              CA    98005 True
0010
000-
11-    KKKKK              PPPPPP                    808 555-5555      One Microsoft Way       Redmond              CA    98005 True
0011
000-
11-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0450
000-
11-    Hi!                Arash                     808 555-5555      Iran                                         CA    98005 False
1111
000-
11-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1234
000-
11-    Dwarf              Dopy                      503 123-8787      Bob way                 Greenland            UT    97321 True
1299
000-
11-    Hi                 How                       808 555-5555      Good                    Redmond              IN    98005 False
4444
000-
12-    Doe                qw                        808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
000-
12-    Doe                John                      808 555-5555                                                   CA    98005 False
1111
000-
15-    Doe                John                      808 555-5555      One Microsoft Way                            CA    98005 True
9999
000-
20-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
000-
20-    Bond               James                     808 555-5555      1 Octopussy Street      Redmond              CA    98005 True
0007
000-
20-    Smith              Fred                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0543
000-
21-    324                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (13 of 36) [4/02/2002 8:54:08 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
21-    Mustermann         Max                       808 555-1111      One Microsoft Way       Redmond              KS    98005 True
9523

000-
22-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
000-
22-                                                                   One Microsoft Way       Redmond              CA    98005 False
2222
000-
25-    Le                 Hanh                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
4256
000-
26-    Bates              Ron                       808 555-5555      One Microsoft Way       Redmond              CA    98005 False
2626
000-
28-    Espa               Alfonso                   987 654-3210      One Microsoft Way       Redmond •            UT    54321 False
1000
000-
44-    Doen               John                      808 555-5555      One Microsoft Way       Redmond              KS    98005 False
0000
000-
44-    Doe                asdfasdfasdf              808 555-5555      One Microsoft Way       Redmond              CA    98005 False
5555
000-
44-    Narayanankutty     Vakkalathu                333 555-5555      A-Way from home         Kerala, India        IN    98005 False
6666
000-
55-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
000-
55-    blah               John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1234
000-
55-    Dale               Sides                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
4239
000-
65-    Dover              Ben                       808 555-5555      One Microsoft Way       Redmond              MI    98005 True
4321
000-
66-    Wilson             Bucky                     808 555-5555      123 AnyRoad             SomeWhere            OR    98005 True
0000

000-
66-    Doe                Jeff                      800-445-4545      One Microsoft Way       Redmond              CA    98005 True
1234
000-
69-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0069
000-
76-    Söderlund          6587675                   000 786-1243      yuoiu                   yoiuyi               CA    65432 False
1243
000-
77-    Lee                fdsfdsfds                 808 555-5555      One Microsoft Way       Redmond              CA    98005 True
0000
000-
77-                       John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0001
000-
77-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
7777
000-
78-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
000-
86-    Deadman            Ima                       808 555-5555      Bin Lyin Low            Lair 29              UT    86868 False
0000




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (14 of 36) [4/02/2002 8:54:09 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

000-
88-    Onur               gumus                     808 555-5555      One Microsoft Way       Redmond              KS    98005 False
0000

000-
88-    Doe                Cris                      808 555-5555      One Microsoft Way       Redmond              IN    98005 False
0654
000-
88-    Rumsfeld           Donald                    808 555-5555      White House             Washington DC        IN    98005 True
1234
000-
90-    Dupont             Maurice                   808 555-5555      rue du pont             merac                TN    98005 True
0012
000-
90-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0098
000-
98-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              MD    98005 True
0000
000-
99-    Olsson             Christer                  808 555-5555      One Microsoft Way       Redmond              CA    98005 True
0000
000-
99-    kamlakar           madhavi                   808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0034
000-
99-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0038
000-
99-    2222222            John1111                  808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8888
000-
99-    Doe1               John2                     808 555-5555      One Microsoft Way       Redmond              KS    98005 True
8889
000-
99-    Peters             Andrew                    808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9999
001-
00-    Doe                Allian                    808 555-5555      One Microsoft Way       Redmond              IN    98001 True
0000
001-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0001

001-
00-    Michael            Jordan                    800 DIV-ORCE      NO Way                  choongju             CA    98005 False
0021
001-
00-    harvey             John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0125
001-
00-    Doe2               John2                     808 555-5555      One Microsoft Way2      Redmond2             IN    98005 True
1000
001-
00-    Wanker             John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
4321
001-
00-    Bin Laden          Osama                     1-800-DIG-ME      One Cold Cave           Kandehar             MD    98005 True
4322
001-
01-    Bengal             John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 True
0000
001-
01-    a dob dob          rob                       808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0001
001-
01-    sejeong            Lee                       808 555-5555      One Microsoft Way       choongju             CA    98005 False
0011




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (15 of 36) [4/02/2002 8:54:09 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

001-
01-    Hunt               Mike                      800 328-8862      One Bad Chick           Hosebag              CA    06969 False
4323

001-
02-    xian               Lee                       808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0004
001-
02-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
2223
001-
10-    Doed               sd                        808 555-5555      One Microsoft Way       Redmond              IN    98005 False
0100
001-
61-    Bengal             Benoit                    808 555-5555      Salut                   Redmond              CA    98005 False
0000
001-
62-    Bengal             Benoit                    808 555-5555      Vive la France          Paris                CA    98005 True
0000
001-
99-    Ashley             Alex                      808 555-5555      One Microsoft Way       Redmond              MD    98005 False
0000
004-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
005-
00-    Sibal              Pavan                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
006-
88-    George             B.                        440 123-2345      One Middle Road         Elyria               OR    55505 False
6543
007-
00-    S                  Rams                      808 555-5555      great Indian            Bangalore            IN    55555 False
7007
007-
01-    Bellot             Demis                     808 555-5555      The Microsoft Way       Redmond              MI    98005 True
0070
007-
12-    Gulliksen          Paul-Sverre               808 555-5555      One Microsoft Way       Redmond              TN    98005 False
0050
009-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              KS    98005 True
1000

010-
00-    Qwerty             Asdf                      808 555-5555      One Microsoft Way       Redmond              CA    98005 True
0000
010-
00-    Jones              Ginger                    808 555-5555      One Microsoft Way       Redmond              MD    98005 False
6666
010-
01-    Mister             Jalfrezi                  808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0100
010-
01-    Ryan               John                      808 555-5555      8 Denmark St            Redmond              CA    98005 False
9999
010-
10-    Hammet             Dashell                   808 555-4444      Far away from           Here                 KS    98005 False
1010
010-
20-    Breiling           Noel                      925 287 1513      One Microsoft Way       Redmond              CA    98005 False
0030
010-
60-    Marshall           Vladovsky                 808 555-5555      One Microsoft Way       Redmond              CA    98005 False
7224
011-
00-    Velasquez          Andrea                    808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (16 of 36) [4/02/2002 8:54:09 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

011-
00-    DoeD               John                      808 555-5555      One Microsoft Wa0       Redmond              CA    98005 False
0009
011-
00-    Valdez             Carina                    808 555-5555      One Microsoft Way       Redmond              MD    98005 True
1111
011-
01-    Doe                Jo                        808 555-5555      One Microsoft Way       Redmond              IN    98005 False
9999
011-
10-    Doe                bob                       nunya                                     Austin               TN    98005 False
0101
011-
11-    Men                Love                      808 555-1111      One Microsoft Way       Redmond              MI    98005 True
1010
011-
11-    ••                 J                         808 555-5555      One Microsoft Way       ••                   IN    98005 False
9779
011-
11-    ••                 J                         808 555-5555      One Microsoft Way       Redmond              IN    98005 False
9889
011-
11-    D                  J                         808 555-5555      One Microsoft Way       Redmond              IN    98005 False
9999
012-
03-    X                  Mr.                       000-111-2222      One Microsoft Way       Redmond              CA    98005 False
0456
012-
34-    Kaffenberger       Albert                    415-292-7243      One Microsoft Way       Redmond              CA    98005 True
5678
017-
01-    Butt               Sumair                    808 555-5555      One Microsoft Way       LA                   CA    98005 True
0056
017-
11-    ddd                fff                       808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
020-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0001
020-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1000
022-
00-    sac                sss                       808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0004
022-
10-    sac                sss1                      808 555-5555      One Microsoft Way       Redmond              KS    98005 False
0004
023-
00-    luvin              wookie                    808 555-5555      123 Tatoine             Redmond              CA    98005 False
0000
040-
00-    boccara            ilanit                    808 555-5555      One Microsoft Way       Redmond              CA    98005 True
0040
042-
42-    Thobbe             Rom                       808 555-5555      One Microsoft Way       Redmond              UT    98005 False
0042
043-
85-    Bingo              Boy                       018-424-4113      No Way                  Atlantis             KS    38009 True
8411
050-
00-    ddddd              ccccc                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
050-
06-    abc                John                      55                Germany                 Detmold              CA    32760 False
0000




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (17 of 36) [4/02/2002 8:54:09 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

056-
00-    Rudy               Raul                      808 555-5555      the house on the hill       anytown              UT   98005 True
7474
056-
00-    Rudy               Raul                      808 555-5555      the house on the hill       anytown              UT   98005 True
9999
056-
99-    Rudy               ^^^^^^^^^^^^^^ 808 555-5555                 the house on the hill       anytown              UT   98005 True
9999
060-
00-    Doe                John                      808 555-5555      One Microsoft Way           Redmond              CA   98005 True
0088
065-
00-    Lee                Young                     808 555-5555      One Microsoft Way           Redmond              CA   98005 False
0000
065-
01-                                                 808 555-5555      One Microsoft Way           Redmond              CA   98005 False
0000
065-
02-    leee               youngg                    808 555-5555      One Microsoft Way           Redmond              CA   98005 False
0000
070-
19-    Pedersen           Brian                     12 23 23 23       Rådhuspladsen 2             Højbjerg             DK   82700 True
0000
089-
70-    asdffgdffghfgh     wdrxfgghfgnvvbn           949578-40684      werwsdffghtyutyihjkjklioo   ererererererererer   MD   98646 True
5056
090-
00-    Smith              Steve                     808 555-5555      One Microsoft Way           Redmond              CA   98005 True
1111
090-
04-    Doe                John                      808 555-5555      One Microsoft Way           Redmond              CA   98005 False
6543
090-
09-    ABCD               DCBA                      808 555-5555      One Microsoft Way           Redmond              KS   11111 False
0909
090-
99-    Doe                John                      808 555-5555      One Microsoft Way           Redmond              CA   98005 False
0990
099-
00-    Toe N Feet         Slap                      808 555-5555      No Way                      Deadmond             wa   98005 False
9999
099-
99-    Doe                John                      808 555-5555      One Microsoft Way           Redmond              CA   98005 False
9099
099-
99-    Doe                John                      808 555-5555      One Microsoft Way           Redmond              OR   98005 False
9999
100-
00-    Doe2               Jack                      808 555-5555      One Microsoft Way           Redmond              CA   98005 False
0000
100-
00-    Doe3               Jack                      808 555-5555      One Microsoft Way           Redmond              IN   98005 True
0001
100-
00-    Doe                Jack                      808 555-5555      One Microsoft Way           Redmond              CA   98005 False
0002
100-
00-    Doe                John                      808 555-5555      One Microsoft Way           Redmond              CA   98005 False
0008
100-
00-    Doe                Jack                      808 555-5555      One Microsoft Way           Redmond              CA   98005 False
0009
100-
00-    Doe                John                      808 555-5555      One Microsoft Way           Redmond              CA   98005 False
0034




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (18 of 36) [4/02/2002 8:54:09 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

100-
00-    Doe                John                      808 555-5555      One Microsoft Way                            MI    98005 True
0098
100-
       Ribeiro
00-                       Danilo                    111 222-3333      My Address              My City              KS    09110 False
       Gianechini
0666
100-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond3             CA    98005 False
1000
100-
00-    tt                 John                      808 555-5555      One Microsoft Way       Redmond              UT    98005 True
1024
100-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
7777
100-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9991
100-
02-    lillqvist          dani                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0300
100-
10-    Yupid              Es                        808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
100-
10-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              MI    98005 True
0001
100-
10-                                                 808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1000
100-
20-    Hotzenplotz        Räuber                    0815              Waldweg 13              Spessart City        TN    54321 False
0300
100-
20-    Hotzenplotz        Räuber                    0815              Umlaute äöüÄÖÜß         Spessart City        TN    54321 False
0301
100-
34-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0049
100-
50-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
100-
50-    zimmdude           John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0009
100-
55-    XXX                Mattia                    808 555-5555      One Microsoft Way       Trento,Italy         CA    98005 False
0000
100-
99-    Doe 999            Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
100-
99-    Shivakumar         Subramaniam               042 952-450       india                   coimbatore           TN    63840 True
0098
101-
01-    Sinatra            Frank                     808 555-5555      One My Way              Or_the_Highway       CA    98005 True
0101
101-
01-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1090
101-
11-    gupta              puvvada                   91-040-79901      24-237, MarutiNagar     Secunderabad, AP     IN    50001 False
1010
101-
11-    Hurpskman          Barles                    303 555-5555      One Microsoft Way       Redmond              KS    98005 True
1111




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (19 of 36) [4/02/2002 8:54:09 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

102-
25-    ••••••             ••••••••••                991 040-7990      •••••••••                  •••••             CA    11111 False
1254
110-
00-    Janey              John                      808 555-5555      One Microsoft Way          Redmond           CA    98005 False
0011
110-
10-    Doe                John                      808 555-5555      One Microsoft Way          Redmond           CA    98005 False
1233
110-
98-    Doe                John                      808 555-5555      One Microsoft Way          Redmond           MD    98005 True
0000
110-
99-    Doe                John                      808 555-5555      One Microsoft Way          Redmond           CA    98005 False
0099
111-
00-    Doe                Jack                      808 555-5555      One Microsoft Way          Redmond           CA    98005 False
0000
111-
00-    Doe                John                      808 555-5555      One Microsoft Way          Redmond           CA    98005 False
0001
111-
00-    Doe                John                      808 555-5555      One Microsoft Way          Redmond           KS    98005 False
0034
111-
00-    Otero              Javi                      808 555-5555      Prueba                     Redmond           CA    98005 False
0069
111-
00-    Ola                Nordmann                  808 555-5555      One Microsoft Way          Redmond           CA    98005 False
0300
111-
00-    Doe                John                      808 555-5555      One Microsoft Way          Redmond           CA    98005 False
1234
111-
00-    Doe                John                      808 555-5555      One Microsoft Way          Redmond           CA    98005 False
4444
111-
00-    Gary               Preece                    222-222-2222      One Microsoft Way          Redmond           CA    98005 True
9999
111-
01-    Lam                John                      808 555-5555      One Microsoft Way          Redmond           CA    98005 False
1234
111-
11-    kumar1             vasanth1                  777-999-9456      II floor nelson towers     Zurich            KS    94010 False
0123
111-
11-    Doe                John                      808 555-5555      One Microsoft Way          Redmond           CA    98005 False
1000
111-
11-    Doe                Jack                      808 555-5555      One Microsoft Way          Redmond           CA    98005 False
1111
111-
11-    Ansari             Najmul                    808 555-5555      Aliganj                    Lucknow           OR    22602 False
1112
111-
11-    hagman             John                      808 555-5555      One Microsoft Way          Redmond           CA    98005 False
1119
111-
11-    Hasan              Atif                      111-222-3333      1574 Irvine Center Drive   Irvine            CA    92782 False
1123
111-
11-    MURAATTTTT         John                      808 555-5555      One Microsoft Way          Redmond           KS    98005 False
1234
111-
11-    Lohan              Harendra                  808 555-5555      One Microsoft Way          Rochester         CA    98005 False
2222




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (20 of 36) [4/02/2002 8:54:09 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

111-
11-    Lohan              Harendra                  2121212           One Microsoft Way         Rochester          CA    98005 False
2223

111-
11-    Doe                John                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
2333
111-
11-    Johnson            Tom                       123-123-1234      Down My Street            Da Burg            PA    23462 False
7892
111-
11-    Moreland           Richard                   808 555-5555      One Microsoft Way         Redmond            CA    98005 False
9898
111-
11-    kim                jazi                      555 555-1212      One Microsoft Way         Redmond            CA    98005 False
9999
111-
12-    •ugugug            jhjklhjklgjkgkj           808 555-5555      One Microsoft Way         Redmond            CA    98005 False
1234
111-
12-    Doe                John                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
2222
111-
13-    Wallace            Gromit                    808 000-1111      One Microsoft Way         Redmond            CA    98005 True
1234
111-
22-    Walla              Peter                     808 555-5555      One Microsoft Way         Graz               CA    98005 False
1111
111-
22-    Smith              Emm                       701 555-5555      One Microsoft Way         Redmond            CA    90210 False
1155
111-
22-    Wallace            Anna                      800 333-4567      One Microsoft Way         Redmond            TN    98005 False
1234
111-
22-    Doe                John                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
2222
111-
22-    Doe                John                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
3331
111-
22-    Doe                Jack                      808 555-5555      Albert                    Austin             OR    98005 False
3333

111-
22-    Paulo              Pereira                   555 555-5555      Rua Tal nº 888            Guaracity          CA    12345 True
3335
111-
22-    Newborn            Pictures                  207 761 0110      http://www.newbornpix.com Portland           OR    04101 True
3345
111-
22-    Doe                John                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
4444
111-
22-    D                  D                         808 555-5555      One Microsoft Way         Redmond            CA    98005 False
5555
111-
24-    asdfadsf           asdfadsf                  808 555-5555      One Microsoft Way         Redmond            CA    98005 False
3434
111-
43-    DoeQQQ             Jack                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
0454
111-
50-    Doe                John                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
0000
111-
99-    gggg               John                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
0000




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (21 of 36) [4/02/2002 8:54:10 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

111-
99-    Bob                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 True
1234

111-
99-    McLaren            Bruce                     666-666-0915      5 Davonshire Drive      Pittsburgh           CA    15238 True
9999
112-
23-    Deere              John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9783
112-
23-    Plumb              Adam                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9999
112-
55-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6666
120-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
120-
00-    Doel               John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1001
120-
08-    Busta              Rime                      808 555-5555      One No Way              San Man              KS    98005 False
0098
121-
00-    Xiao               Be                        808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
121-
10-    Doe                Vincent                   808 555-5555      One Microsoft Way       Redmond              KS    98005 False
1989
121-
12-    Eperez             eperez                    448410042         Abeto                   SLP                  CA    78130 False
1212
121-
12-    TESTRO             Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
3214
121-
22-    Does               Johns                     808 555-555       One Microsoft Way       Redmond              CA    98005 False
1133
121-
80-    Does               John23                    2                 One Microsoft Way1      Redmond              CA    98005 True
5753

122-
12-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1212
122-
22-    test               John                      123 123-1233      One Microsoft Way       Redmond              CA    98005 False
1234
122-
32-    akrouk             samer                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1111
123-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
123-
00-    pippo              hjbh                      bhjbhj            bhjb                    jhbhj                CA    98005 False
0034
123-
00-    Joe Smith          Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1111
123-
00-    Egil               Rød                       808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1212
123-
00-    Bicalho            Elton                     808 555-5555      Rua tal                 Cuiabá               MD    98005 True
1234




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (22 of 36) [4/02/2002 8:54:10 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

123-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
5432

123-
06-    van Woudenberg Peter                         808 555-5555      One Microsoft Way       Redmond              IN    98005 False
4000
123-
11-    France             LeoAAAA                   808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1111
123-
11-    Kumar              Dilip                     808 555-5555      One Microsoft Way       Redmond              OR    45220 False
2000
123-
12-    Kwoang-Sik         Min                       016 327-5555      One Microsoft Way       Seoul                CA    98045 False
0915
123-
12-    Doe1               Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1234
123-
12-    Joe                Blow                      904-555-1212      One Microsoft Way       Redmond              CA    98005 True
1564
123-
12-    Mike               Nash                      808 555-5555      One Microsoft Way       San Francisco        CA    94105 True
2345
123-
12-    Deleu              Regine                    092 722-3100      Guldensporenpark        Merelbeke            OR    98005 True
3625
123-
12-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6666
123-
12-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9999
123-
16-    leo                Kats                      816 555-5555      11430Cross              Olathe               KS    66222 False
7890
123-
22-    Gugus              Gaga                      808 555-5555      One Microsoft Way       Redmond              OR    98005 True
1234
123-
33-    Doe                Jack                      808 555-5556      2 Microsoft Way         Redmond              CA    98005 False
3243

123-
33-    Jain               Rajesh                    768-098-7868      1, Wood Avenue          Iselin               CA    98005 True
3456
123-
44-    isr                ww                        999-522-5562      One Microsoft Way       Redmond              OR    98005 True
4455
123-
44-    Doe3               John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9898
123-
45-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
123-
45-    viswanath          jawalakr                  808-555-4444      One Microsoft Way       Redmond              CA    34534 False
3678
123-
45-    Kamala             Tasha                     919 555-1243      2 Black Dog Way         Kary                 TN    37205 True
6789
123-
45-    dosey do           John                      808 555-5555      One Microsoft Way       ROBERT               CA    98005 False
6798
123-
45-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
7890




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (23 of 36) [4/02/2002 8:54:10 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

123-
45-    Engineer           John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9876
123-
55-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
123-
55-    Rex                Noah                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0007
123-
55-    4                  John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0008
123-
55-    Thomson            Scott                     654 654-6544      116 Elgin Drive         Brampton             OR    09833 True
7890
123-
59-    floyd              pittman                   808 555-5555      One Microsoft Way       Redmond              CA    33055 False
6789
123-
64-    KKKKK              PPPPPP                    808 555-5555      One Microsoft Way       Redmond              CA    98005 True
0000
123-
64-    KKKKK              PPPPPP                    808 555-5555      One Microsoft Way       Redmond              CA    98005 True
0001
123-
89-    Kevin              Satterthwaite             808 555-5555      12345-12 St             Edmonton             CA    98005 False
9874
123-
90-    Dot Not            Yet                       808 555-5555      Microsoft Cul-de-Sac    Paris                CA    98005 True
0000
123-
98-    Max                Tester                    01 12234444       Test                    Sydney               KS    98005 True
6655
123-
99-    Robert             Taylor                    808 555-5555      123 Murdock St.         Marietta             CA    98005 False
9999
127-
85-    Haulund            Jens                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
2211
131-
31-    Olson              John                      808 555-5555      One Microsoft Way       Redmond              OR    11245 True
3131
140-
09-    Irwan              azam                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0567
142-
25-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
3698
145-
44-    Doe                Dil                       808 555-6666      One Microsoft Way       Redmond              CA    98005 False
7914
151-
15-    Doe                                          808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1515
151-
15-                                                 808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1516
151-
15-                                                                   One Microsoft Way       Redmond              CA    98005 True
1517
151-
15-    Mars               Þ                         808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1518
154-
45-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8798




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (24 of 36) [4/02/2002 8:54:10 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

168-
05-    P                  P                         808 555-5555      One Microsoft Way       Redmond              CA    98005 False
5911
172-
32-    White              Johnson                   408 496-7223      10932 Bigge Rd.         Menlo Park           CA    94025 True
1176
190-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0001
190-
00-    A.P                Arun                      808 555-5555      4/51 thekkuveedu lane   calicut              CA    98005 False
0006
200-
00-    Dobbs              Bob                       808 555-5555      Church of Subgenious    Slackville           CA    98005 True
0000
212-
77-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
4567
213-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 True
0002
213-
46-    Green              Marjorie                  415 986-7020      309 63rd St. #411       Oakland              CA    94618 True
8915
220-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              OR    98005 False
0000
222-
00-    XYZ                ABC                       123-456-5000      God's way               Redmond              CA    98005 False
1243
222-
12-    Avendaño           Cesar                     907 234-5611      Cra 333 # 111           Medellin             MD    11111 True
1234
222-
12-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
3232
222-
22-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
2222
222-
22-    test1              test2                     416 422-0138      testing address 1       Toronto              OR    91111 True
2226
222-
22-    a                  f                         333 434-3334                              Cleveland            IN    34344 False
3322
222-
22-    a                  f                         333 434-3334      sadfds                  Cleveland            IN    34344 False
3332
222-
88-    ravi               chand                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
2234
224-
45-    Pest               Bug                       616-659-5986      Peach Tree Rd.          Kalamazoo            MI    69582 True
9875
230-
00-    Doesett            Johnathan                 804 555-5544      One Microsoft Ways      gulatan              IN    68005 False
0300
232-
56-    Sexy               Glamorous                 808 555-5555      Play Boy Mansion        California           CA    98005 True
5150
233-
44-    Alexandre          Jorge                     555 234-4456      Bombarral               Bombarral            KS    25401 False
5544
234-
34-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              KS    98005 False
3444




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (25 of 36) [4/02/2002 8:54:10 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

234-
99-    qqqq               vvvv                      808 777-4444      P.O. Box 247            seoul                MD    98555 True
9999
238-
95-    Carson             Cheryl                    415 548-7723      589 Darwin Ln.          Berkeley             CA    94705 True
7766
239-
95-    Someone            aaaaaaa                   808 555-5555      One Microsoft Way       Redmond              CA    98005 False
7766
240-
00-    Greenwood          Seb                       808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
254-
85-                       John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
254-
85-                                                 808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0500
254-
85-                                                                   One Microsoft Way       Redmond              CA    98005 False
8700
267-
41-    O'Leary            Michael                   408 286-2428      22 Cleveland Av. #14    San Jose             KS    95128 False
2394
269-
54-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0526
274-
80-    HI                 Dean                      415 834-2919      5420 College Av.        Oakland              CA    94609 False
9391
300-
00-    Doe444             John22                    808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0001
302-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
321-
18-    xhan2000           John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0231
321-
32-    Smith              Joe                       808 555-1234      123 First St.           Baltimore            MD    98005 True
4321
321-
54-    Carboxy            Jack                      +31497123456 Far away                     The Netherlands      Br    98005 False
0987
323-
32-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
3233
323-
66-    John               Doe                       666 999-5555      123 Sesame              San Diego            CA    44444 False
5432
324-
45-    Doet               John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
4544
327-
00-    Balun              Delama                    555 555-5555      Hell's gate Road        Planet Moon          MI    11223 True
2546
332-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
333-
00-    LeBlanc            John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
333-
00-    Simon              Simple                    808 555-5555      One Microsoft Way       Redmond              IN    98003 False
0001




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (26 of 36) [4/02/2002 8:54:10 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

333-
00-    something          John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1111
333-
22-    kebeci             Güven                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6666
333-
30-    Robinson           John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
3333
333-
31-    Lala               John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
3000
333-
33-    kishore            krishna                   808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1234
333-
33-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
3333
333-
33-    Çako•lu            Mehmet                    808 555-5555      Thin green mile         istanbul             MD    34400 False
3399
341-
22-    hey                Meander                   913 843-0462      10 Mississippi Dr.      Lawrence             KS    66044 True
1782
343-
33-    Tang               Putti                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
345-
67-    xxx                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
348-
88-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
3874
355-
76-    Jim                Rieck                     8476959476        One Microsoft Way       Redmond              CA    98005 False
5317
357-
27-    Doe                lklll                     808 555-5555      One Microsoft Way       ond                  IN    98005 True
9870
357-
27-    Doe                lklll                     312-555-5555      One Microsoft Way       ond                  IN    98005 True
9873
366-
26-    LaForge            Geordi                    1-800-STA-RS      One Microsoft Way       Franklin             TN    37067 True
8404
378-
87-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8737
394-
00-    Lazius             Mike                      808 555-5555      One Microsoft Way       Redmond              UT    98005 True
9374
395-
26-    Capsher            John                      987 654-3210      1212 Loop 12            Dallas               OR    98005 False
2222
399-
99-    pippi              calzelunghe               808 555-5555      One Microsoft Way       San francisco        CA    14725 False
3999
400-
00-    Yo                 YoYo                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0077
409-
56-    john               Abraham                   415 658-9932      6223 Bateman St.        Berkeley             CA    94705 False
7008
427-
17-    DullnDumb          Ann                       415 836-7128      3410 Blonde St.         Palo Alto            CA    94301 True
2319




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (27 of 36) [4/02/2002 8:54:10 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

432-
00-    Anka               Kalle                     808 555-5555      One Microsoft Way         Redmond            CA    98005 False
0000
440-
90-    Pegg               Jeffrey                   918 361-7344      2448 E 81st               Tulsa              OR    74137 True
7785
443-
00-    Beee               WHO                       22222222          2223 dfdsf                Redmonds           KS    98004 True
0001
443-
23-    Hard               Rock                      696 969-6969      One Stiff Way             peters town        Co    69696 False
5543
444-
44-    Tomaylla           Juan                      808 555-5555      24 Blue Mont Av.          Miami              CA    98005 True
4444
445-
00-    Hunter             John                      808 555-5555      One MS Way                Redmond            CA    98005 True
0055
446-
44-    Channe             Jaishri                   111 111-1111      Park Chambers, Regopark   Beverly            IN    99345 True
4447
454-
21-    V. Will            Rockyou                   808 555-5555      D. EBERLE                 BIRKENFELD         D     00000 True
3478
454-
21-    Smith              John                      808 555-5555      One Microsoft Way         Redmond            UT    98005 True
8465
456-
99-    DoeEx              JohnEx                    808 555-5555      One Microsoft Way         Redmond            CA    98005 True
0000
472-
27-    Gringlesby         Burt                      707 938-6445      PO Box 792                Covelo             CA    95428 True
2349
486-
29-    Locksley           Charlene                  415 585-4620      18 Broadway Av.           San Francisco      CA    94130 True
1786
500-
00-    Subram             John                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
0092
527-
72-    Greene             Morningstaruuuu           615 297-2723      22 Graybar House Rd.      Nashville          TN    37215 False
3246
555-
00-    Does               Johns                     808 555-5555      One Microsoft Way         Redmond            CA    98005 True
5555
555-
11-    Bin Laden          Osama                     (000) 000-00      Cave 23                   Tora Bora          UT    00000 False
2222
555-
12-    SuperDog           Yahoo                     999-999-9999      One Microsoft Way         Redmond            CA    98005 False
5555
555-
44-    yo                 ne                        808 555-6666      dfdssdf                   sdfsdffdsd         KS    98005 True
3210
555-
44-    Doe                John                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
5567
555-
55-    Daz                Dea                       808 555-5555      One Microsoft Way         Redmond            CA    98005 False
5554
555-
55-    Sheds              Two                       808 555-5555      One Microsoft Way         Copenhagen         CA    98005 False
5555
555-
55-    Doe                John                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
5559




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (28 of 36) [4/02/2002 8:54:11 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

555-
66-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
555-
66-    Doe                Pete                      808 555-5555      happy days              Redmond              CA    98005 False
2222
555-
98-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9855
564-
00-    Doe                Vasa                      808 555-5555      One Microsoft Way       Belgrade             CA    98005 False
0001
585-
88-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9852
600-
00-    Ternopolsky        Andrew                    808 555-5555      One Microsoft Way       Toronto              CA    98005 True
0001
625-
00-    Fernandez          Katrina                   808 555-5555      1550 Iron Point Rd      Folsom               CA    95630 False
0000
634-
23-    Yu Communist       Lee China                 808 555-5555      One Microsoft Way       Redmond              UT    98005 True
7895
648-
92-    Blotchet-Halls     Reginald                  503 745-6402      55 Hillsdale Bl.        Corvallis            OR    97330 True
1872
664-
21-    Kinaska            Zel Rojo                  885 656 5525      6638 s chestnut         bakersfield          TN    99852 False
1125
666-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
666-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0088
666-
00-    al-Zawahiri        Ayman                     666 666-6666      Prime Evil House        Hell                 TN    66666 True
0666
666-
55-    Doe                Jack                      808 555-5555      One Microsoft Way                            CA    98005 False
8888
666-
66-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6665
666-
66-    Foot               lame-0                    204 999-9999      Freq Station Zero       38DD-34-38           OR    99999 True
6666
666-
66-    Dingle             Barry                     214-748-1414      1313 Mockingbird Ln.    Dallas               TN    77777 True
6969
666-
66-    LIN                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
7777
666-
66-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9999
666-
99-    Dope               John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0666
666-
99-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
5655
672-
71-    Yokomoto           Akiko                     415 935-4228      3 Silver Ct.            Walnut Creek         CA    94595 True
3249




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (29 of 36) [4/02/2002 8:54:11 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

678-
00-    jane               young                     025-34324324      nanjing                     ••               CA    98005 False
9876
696-
69-    Bader              Nathan                    808 555-5555      Enviance                    San Diego        CA    92009 True
6969
700-
00-                       John                      808 555-5555      One Microsoft Way           Redmond          CA    98005 False
1234
700-
00-    Doesdfad           John                      808 555-5555      One Microsoft Way           Redmond          MD    98005 False
1235
712-
45-    del Castillo       Innes                     615 996-8275      2286 Cram Pl. #86           Ann Arbor        MI    48105 True
1867
722-
51-    DeFrance           Michel                    219 547-9982      3 Balding Pl.               Gary             IN    46403 True
5454
724-
                                                                      5420 Telegraph Av. sdsdfs
08-    Stringer           Dirk                      415 843-2991                                  Oakland          CA    94609 False
                                                                      ds d sdf sdf s
9931
724-
80-    MacFeather         Stearns                   415 354-7128      44 Upland Hts.              Oakland          CA    94612 True
9391
736-
83-    Blah Blah Blah     Zeke                      808 555-5555      One Microsoft Way           Redmond          CA    98005 False
3231
745-
65-    Dane               Jackson                   888-563-9865      25 Wetworks Circle          Los Angeles      CA    90025 True
6578
756-
30-    Karsen             Livia                     415 534-9219      5720 McAuley St.            Oakland          CA    94609 True
7391
758-
00-    Ongenae            Veerle                    oeps              Straat                      Stad             UT    12369 False
0002
758-
00-    gdgdgd             gdgdg                     522 555-7777      gerrelll                    erg              IN    78569 True
8888
764-
98-    Kuk                Mr                        808 555-5555      One Microsoft Way           Redmond          KS    98005 False
2345
770-
00-    Doe                John                      808 555-0055      One Microsoft Way                            CA    98005 False
0000
777-
00-    olivier            Jack                      808 555-5555      One Microsoft Way           Redmond          CA    98005 False
0000
777-
22-    I.P.               Freely                    808 555-5555      One Microsoft Way           Redmond          CA    98005 False
3333
777-
55-    Graham             Innes                     0123456789        One Microsoft Way           Redmond          CA    98005 True
1234
777-
77-    Nair               Shalini                   686 555-5555      SGI                         Bombay           Mp    98005 False
7777
777-
99-    Huba               Haba                      555-555-5555      known Street                Mexico           CA    03100 False
7777
787-
00-    hhh                John                      808 555-5555      One Microsoft Way           Redmond          CA    98005 False
0999
789-
12-    Jeff               Annequin                  808 555-5555      One Microsoft Way           Paris            OR    98005 False
4567




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (30 of 36) [4/02/2002 8:54:11 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

800-
00-                                                 808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
800-
00-    Doe1               Jimmy1                    808 555-2131      Ate Microsoft Why1      Tigard1              UT    98001 False
0008
800-
00-    gdgdgd             gdgdg                     522 555-7777      gerrelll                erg                  IN    78569 True
8888
800-
00-    Park               Hyung                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8889
800-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9999
807-
91-    Panteley           Sylvia                    301 946-8853      1956 Arlington Pl.      Rockville            MD    20853 True
6654
808-
11-    McEwan             Robert                    808 123-8888      One My Way              LA                   CA    98052 True
8088
809-
00-    V•l                Kokot                     808 555-5555      One Microsoft Way       Redmond              IN    98005 False
0111
825-
43-    SMITH              PAT                       808 555-6789      On'e Microsoft Way      Redmond              CA    98005 False
1234
829-
45-    Smith              Mike                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6587
846-
92-    Hunter             Sheryl                    415 836-7128      3410 Blonde St.         Palo Alto            CA    94301 True
7186
847-
57-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1348
847-
57-    'Tim               Powers'                   808 555-5555      One Microsoft Way       Annapolis            MD    98005 False
1349
888-
00-    Wyckoff            Jason                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
888-
00-    Charbonneau        John                      808 878-8646      One Microsoft Way       Redmond              CA    98005 True
8877
888-
00-    gdgdgd             gdgdg                     522 555-7777                              erg                  IN    78569 True
8888
888-
11-    Meister            Mik                       808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8888
888-
26-    Harry              Horn                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
7143
888-
77-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
6666
888-
77-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8888
888-
88-    Zhang              Paul                      808 555-5555      One Microsoft Way       Redmond              IN    98005 False
8881
888-
88-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8888




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (31 of 36) [4/02/2002 8:54:11 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

888-
88-    Giuliani           Rudolph                   808 555-5555      One Microsoft Way       Redmond              MD    98005 False
8889

888-
88-    zzz                hhh                       800 123-4567      life                    Redmond              CA    98065 True
9999
888-
99-    Magosso            Fabrizio                  9362075           Rua Major Gama          New York             CA    11111 False
9999
893-
72-    McBadden           Heather                   707 448-4982      301 Putnam              Vacaville            CA    95688 False
1158
895-
57-    Condor             Elson                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
5418
895-
86-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8759
899-
46-    Ringer             Anne                      801 826-0752      67 Seventh Av.          Salt Lake City       UT    84152 False
2035
899-
89-    Mishra             Rajib                     808 555-5555      One Microsoft Way       Redmond              CA    98005 True
8989
900-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
900-
00-    Wang               Qiang                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0001
900-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              IN    98005 False
0003
900-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1111
900-
00-    a                  a                         808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8000
900-
90-    Maar               Doe                       808 555-5555      Microsoft (One Way)     Hopper               UT    98005 True
9000

900-
99-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
901-
90-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0001
902-
90-    Shinde             Suhas                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0001
908-
00-    Gott               Karel                     808 555-5555      One Microsoft Way       Redmond              UT    98005 True
0000
909-
99-    Wasielewski        Steve                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
3333
912-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0099
928-
23-    Kuhn               Ben                       716 424-8155      123 Nowhere St          Corvallis            OR    01812 True
1324
953-
99-    Injamuri           Ephraim                   808 555-5555      Bharathi Sadan          Bommuru              CA    90701 False
0928




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (32 of 36) [4/02/2002 8:54:11 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

978-
89-    Saevik             Erling Antoni             92929292          Test                    Test                 CA    98005 False
8070

980-
00-    pppppppppppppp John                          808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9999
981-
88-    Castillo           Manuel                    808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9898
987-
00-    Saw                Alan                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9999
987-
22-    Doe                John                      818 555-1212      One Microsoft Way       Redmond              CA    98005 False
3344
987-
65-    ••••               Johsdfsdfn                808 555-5555      One Microsoft Way       Redmond              TN    98005 True
4321
987-
87-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9876
988-
00-    gdgdgd             gfhfghh                   522 555-7777                              erg                  IN    78569 True
8888
990-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
990-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9999
995-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
998-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
998-
01-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
998-
72-    Ringer             Albert                    801 826-0752      67 Seventh Av.          Salt Lake City       UT    84152 True
3567

999-
00-    aaa                Jun                       808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
999-
00-    obilic             sinisa                    808 555-5555      One Microsoft Way       Redmond              KS    98005 True
0001
999-
00-    Doeiuii            John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0009
999-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98002 False
0010
999-
00-    Doe                Jack                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0011
999-
00-    Rasputen           John                      808 555-5555      TestStreet              Billings             MI    45677 False
0987
999-
00-    Does               Johny                     808 555-5559      Two Microsoft Way       Redmon               IN    98009 True
2222
999-
00-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
8903




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (33 of 36) [4/02/2002 8:54:11 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

999-
00-    Cristian           Rissone                   808 555-5555      One Microsoft Way       Rissone              CA    98005 False
9999
999-
11-    Doe1               John1                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0100
999-
11-    blow               dude                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1001
999-
22-    DoeXXXXXXXXX       John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
999-
22-    andi               andi                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9999
999-
23-    Wilmotte           Philippe                  808 555-5555      One Microsoft Way       Redmond              MI    98005 True
0577
999-
33-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
3245
999-
45-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1324
999-
45-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
9999
999-
55-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
2564
999-
88-    S                  SD                        111 234-6545      s                       s                    KS    11234 True
7645
999-
88-    Dough              Johnny                    808 555-5555      One Microsoft Way       Redmond              CA    98005 False
7777
999-
99-    Bend               Dover                     808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0000
999-
99-    Doen               Johnson                   808 555-5552      One Microsoft Way?      Redmond              MI    98005 True
0001
999-
99-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0009
999-
99-    Khan               Arif                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0165
999-
99-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
0191
999-
99-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1111
999-
99-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
1112
999-
99-    hoyle              Jack                      808 555-5555      no Microsoft Way        new orleans          TN    98005 False
1234
999-
99-    Kushner            Mike                      (330) 757-43      3 Ms Drive              Poland               KS    44505 True
3998
999-
99-    Doe                John                      808 555-5555      One Microsoft Way       Redmond              CA    98005 False
5724




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (34 of 36) [4/02/2002 8:54:11 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

999-
99-    monkey             John                      808 555-5555      One Microsoft Way         Redmond            KS    98005 False
5758

999-
99-                                                                   One Microsoft Way         Redmond            CA    98005 False
5944
999-
99-    caruso             paskosky                  808 555-5555      One Microsoft Way         Redmond            CA    98005 False
5945
999-
                                                                                                Buenos Aires
99-    Mark               Lodesones                 850 546-5698      Micri                                        CA    98005 True
                                                                                                Argenti
8888
999-
99-    chen               yin                       808 555-5555      test                      Redmond            CA    98005 False
9199
999-
99-    Doey               \                         808 555-5555      One Microsoft Way         Redmond            CA    98005 False
9678
999-
99-    Ovalson            Condom                    808 6666-666      One Microsoft Way         Redmond            CA    98005 False
9910
999-
99-    Doesdfsdf          Jacksdfsdf                fsdfsdfsdfsd      One Microsoft Way         Redmond            CA    98005 False
9911
999-
99-    Doe                John                      808 555-5556      One Microsoft Way         Redmond            CA    98005 False
9912
999-
99-    hayne              John                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
9913
999-
99-    Abbott             Graham                    808 555-5555      Nine Microsoft Way        Redmond            UT    98005 True
9914
999-
99-    Khan               Arif                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
9977
999-
99-    yong-bum           cha                       808 555-5555      One Microsoft Way         Redmond            CA    98005 False
9988
999-
99-    Doey               John                      808 555-5555      One Microsoft Way         Redmond            CA    98005 False
9989

999-
99-    schenshul          schenshul                 808 555-5555      ICR                       Hartford           CT    98005 False
9990
999-
99-    lep                j                         808 555-5555      One Microsoft Way         Redmond            CA    98005 False
9991
999-
                                                                      1100 east woodfield rd,
99-    venzke             glenn                     847-995-8400                                schaumburg         IN    60173 True
                                                                      suite 520
9992

999-
99-    myname             Bill                      02534212345       One Deadbeat lane         Redmond            CA    98005 False
9993
999-
99-    mytest             mytest                    808 555-5555      One Microsoft Way         Ankara             CA    98005 False
9994
999-
99-    Uplny              Harry                     123 435-4356      Smetiar 32                Bratislava         CA    81000 False
9995
999-
99-    akrouk             samer                     808 555-5555      One Microsoft Way         Redmond            CA    98005 False
9996
999-
99-    Doe                Jimmmmm                   808 555-5555      One Microsoft Way         Redmond            CA    98005 False
9997




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (35 of 36) [4/02/2002 8:54:12 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx

999-
99-    well               what                      808 555-5555      hello                   ••                   CA    98005 False
9998
999-
99-    Dennis             Bellot                    555 555-5555      Timeless Winds          Australia            IN    98005 False
9999




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid1.aspx (36 of 36) [4/02/2002 8:54:12 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid2.aspx


Parameterized Select to a DataGrid Control

Select a State:                CA              Get Authors




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid2.aspx [4/02/2002 8:54:43 AM]
 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid3.aspx


Dynamic Parameterized Select to a DataGrid Control

Select a State:                Br              Get Authors




 http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid3.aspx [4/02/2002 8:54:44 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx

   Inserting a Row of Data

    au_id au_lname               au_fname                  phone              address                 city                 state zip   contract   Add a New Author:
    000-
    00-     ana                  Takeit                    100 111-2333       1937 17th Ave           Chuckle City         TN    63841 False
                                                                                                                                                  Author ID:   000-00-0000
    0000
                                                                                                                                                  Last Name: Doe
    000-
    00-     Yozzav               phil                      100 111-2222       Sixtengatan 16          shenzhen             IN    51802 False      First
    0001                                                                                                                                                       John
                                                                                                                                                  Name:
    000-
    00-     Dear                 John                      310 777-8375       123 No Way              Smallville           UT    34523 True       Phone:       808 555-5555
    0002
                                                                                                                                                  Address:     One Microsoft Way
    000-
    00-     MMM                  GoodKKKK                  800 123-4569       Ext Way 123             •stanbul             MO    80300 False
    0003                                                                                                                                          City:        Redmond

    000-                                                                                                                                          State:       CA
    00-     Shit                 Maggie'sTeensfa           905 555-5544       123 Main street         Mississaugadf        KS    12345 False
    0004
                                                                                                                                                  Zip Code:    98005
    000-
    00-     Nisse                Pettersson                123 456-7890       jularbovägen            Stockholm            MD    12345 True       Contract:    False
    0005
                                                                                                                                                                 Add Author
    000-
    00-     Key                  Cindy Cla                 858 555-1212       One San Diego Way 268   244 B IUH IPU        OR    92139 False
    0006

    000-
    00-     XT                   xiangTest                 888 859-7845       12345 Hehaw             Vermont              TN    98005 True
    0007
    000-
    00-     Hakan                Erens                     216 342-1111       Uskudar                 Istanbul             MD    11111 False
    0008

    000-
    00-     Hertz                Jezebel                   808 555-5555       17 Instant Oats Ct      Benjaminia           IN    98005 True
    0009

    000-
    00-     REK                  Real Estate King          808 555-5555       Nutscrape Sucks!!       Redmond              KS    98005 False
    0010

    000-
    00-     Heikkinen            Kimmo                     808 555-5555       Finland                 Espoo                TN    98005 False
    0011

    000-
    00-     Heray                Cuisn                     5555555555         Dead Java Way           Jan Mayen            OR    98005 False
    0012




http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (1 of 52) [4/02/2002 8:55:24 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     Hughee               Mikee                     808 555-5555       One Microsoft Way       Redmond              CA   12345 False
    0013

    000-
    00-     maxsun               pittman1                  305 237-3000       VB Net Wiz              Miami                IN   33132 False
    0014

    000-
    00-     Changc               Zork                      808 555-5555       On My Way               Redmond              CA   98005 False
    0015
    000-
    00-     Hakan                Eren                      216 342-1111       Uskudar                 Mt. Hood             OR   95432 True
    0016

    000-
    00-     efwef33333           Jebo z Lesa               123 435-4356       Smetiar 33              Bratislava           CA   81000 False
    0017

    000-
    00-     pippo                pluto                     293849832          no way23                tel-aviv23           CA   98005 False
    0018
    000-
    00-     amparoklp            amarosa                   808 555-5555       One Microsoft Way       Redmond              IN   98005 True
    0019

    000-
    00-     Morrison             Skot                      808 555-5551       One Microsoft Way       Redmond              CA   98005 False
    0020

    000-
    00-     The Ripper           Jack                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0021

    000-
    00-     Rogériod test        Sampaio                   808 555-5555       One Microsoft Way       Redmond              CA   98005 True
    0022

    000-
    00-     Arsen                Jack                      808 555-5555       One Microsoft Wa        Redmond              CA   98005 False
    0023

    000-
    00-     Doe                  Carlo                     808 555-5555       One Microsoft Way       Redmond              xx   98005 False
    0024

    000-
    00-     Doaks                Joe                       808 555-5553       One Microsoft Way       Redmond              CA   98052 False
    0025

    000-
    00-     Alexio               Knight                    808 555-5555       churchill street        Montreal             CA   98005 False
    0026

    000-
    00-     RAZ                  Fazfaz                    111 111-1111       Apple Computer          L.A.                 OR   99099 True
    0027


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (2 of 52) [4/02/2002 8:55:24 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     Caipang              Nelgraine                 032 2340119        Cebu City, Philippines   Cebu City           CA   98005 True
    0028

    000-
    00-     Ramsha               RD                        091 4255-552       Great Indian             Coimbatore          TN   64100 True
    0029

    000-
    00-     Hu                   Yu                        123 123-1234       One Microsoft Way        Redmond             IN   98005 False
    0030
    000-
    00-     qwrwq                Max                       808 555-5555       One Microsoft Way        Redmond             CA   98005 False
    0031

    000-
    00-     Tester               Theory                    808 555-5555       One Microsoft Way        Redmond             CA   98005 False
    0032

    000-
    00-     Ram                  Ram                       846 676-5555       Indian Gate Way          CBE                 TN   64100 False
    0033
    000-
    00-     Wadd                 Johnny                    702 555-5555       One Paradise Blvd        Las Vegas           NV   89121 False
    0034

    000-
    00-     The Clown            Homey                     554 444-1232       Circus                   Hell                CA   33243 True
    0035

    000-
    00-     Kansas City          Is a Mighty Pretty        But it Aint        Got What                 I got               ks   98005 False
    0036

    000-
    00-     Does Dallas          Harry                     808 555-5555       One Microsoft Way        Redmond             KS   98005 False
    0037

    000-
    00-     Titi                 Toto                      808 555-5555       One Microsoft Way        Paris               IN   75000 True
    0038

    000-
    00-     Dokes                Jeremy                    808 555-5555       One Microsoft Way        Redmond             CA   98005 True
    0039

    000-
    00-     Lowe                 Alex                      808 555-5555       One Microsoft Way        Redmond             CA   98005 False
    0040

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way        Redmond             CA   98005 False
    0041
    000-
    00-     Carlson              Mike                      808 555-5555       One Microsoft Way        Redmond             CA   98005 False
    0042


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (3 of 52) [4/02/2002 8:55:24 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
                                                                              2011 Palomar Airport Road,
    00-     Riad                 Craig                     760 496-0200                                    Carlsbad         CA    92009 True
                                                                              Suite 200
    0043

    000-
    00-     Doeremi              Johnny                    808 555-5555       One Microsoft Way            Redmond          KS    98005 True
    0044

    000-
    00-     Jamie                Washere                   808 555-5555       axaxaxaxaxaxax               axaxaxaxaxaxaxaxa CA   98005 False
    0045
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way            Redmond          CA    98005 True
    0046

    000-
    00-     This .Net is         the best ever!            808 555-5555       One Way                      Redmond          CA    98005 False
    0047

    000-
            Hey, Jen it's
    00-                          Cool eh?                  808 555-5555       Let's Party!!!!              Downtown!        CA    98005 False
            Friiiiday!
    0048
    000-
            Bjorn is the
    00-                          CRAAAAAAAA                808 555-5555       Bow chicka bow wow!          Chicka bow       CA    98005 False
            man!
    0049
    000-
    00-     Bjorn has 12!        Think about it! TWEL      808 555-5555       Bow chicka bow wow Bjorn!    Redmond          CA    98005 False
    0050

    000-
    00-     Kaushik              fefdssfd                  808 555-5555       One Microsoft Way            Redmond          CA    98005 False
    0051

    000-
    00-     olivier              ppol                      808 555-5555       One Microsoft Way            rftyuerter       CA    98006 False
    0052

    000-
    00-     Dias dos Santos      Leonardossss              808 555-5554       One Microsoft Way            Redmond          CA    98005 False
    0053

    000-
    00-     Hockey               Rocks                     808 555-5555       One Microsoft Way            Redmond          CA    98005 False
    0054

    000-
    00-     PIZZA PARTY!         PIZZA PARTY!              808 555-5555       Kabul                        Redmond          MI    98005 False
    0055

    000-
    00-     Test                 Jack                      808 555-5555       One Microsoft Way            Redmond          CA    98005 False
    0056

    000-
            Gingerbread
    00-                          pizza party!              808 555-5555       You hava coupons?            GIMME NOW!!!     CA    98005 False
            Ratte!
    0057


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (4 of 52) [4/02/2002 8:55:24 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     Jen Has some!        Bow chicka Jen!           808 555-5555       hahahahha, im a prude!   no music for me!    CA   98005 False
    0058

    000-
    00-     NERD!                ALERT!                    808 555-5555       Right here, on           THIS PAGE!!!!       CA   98005 False
    0059

    000-
    00-     Hansen               Jack                      808 555-5555       One Microsoft Way        Redmond             OR   98005 False
    0060
    000-
    00-     Albright             Chris                     808 555-5555       One Microsoft Way        Redmond             CA   98005 False
    0061

    000-
    00-     Nat                  Dune                      808 555-5555       One Microsoft Way        Redmond             CA   98005 False
    0062

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way        Redmond             CA   98005 False
    0065
    000-
    00-     voytek               dj                        808 555-5555       One Microsoft Way        Redmond             CA   98005 False
    0066

    000-
    00-     Doe                  jjjjjjj                   808 555-5555       One Microsoft Way        Redmond             CA   98005 False
    0067

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way        Redmond             CA   98005 False
    0069

    000-
    00-     Johnson              Martin                    808 222-1234       Java memorial way        Cochin, India       CA   08873 False
    0070

    000-
    00-     Doe                  Alex                      808 555-5555       One Microsoft Way        Redmond             CA   98005 True
    0071

    000-
    00-     Flintstone           Fred                      808 555-5555       South Africa             Pretoria            TN   98005 False
    0072

    000-
    00-     Does                 Elaine                    808 555-5555       1445 Alpina St           Salina              KS   63004 False
    0077

    000-
    00-     doe                  John                      808 555-5555       One Microsoft WrongWay   Redmond             CA   98009 False
    0078

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way        Redmond             CA   98005 False
    0079


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (5 of 52) [4/02/2002 8:55:24 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     Issa                 Mohammed                  808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0080

    000-
    00-     Doe                  Raghavan                  808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0082

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0085
    000-
    00-     ak1                  ak1                       808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0088

    000-
    00-     Golh                 John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0089

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0090
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0091

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0092

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0098

    000-
    00-     Doe                  juuu                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0099

    000-
    00-     geff                 blatt                     808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0100

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0101

    000-
    00-     Murad                Kayani                    808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0110

    000-
    00-     Rus                  Tome                      808 555-5555       My Way                  Redmond              CA   98005 False
    0111
    000-
    00-     Cheng                Henry                     808 555-5555       One Microsoft Way       Redmond              IN   98005 True
    0112


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (6 of 52) [4/02/2002 8:55:24 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     Doe                  Aaron                     808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0120

    000-
    00-     l                    abcdefg                   808 555-5555       One                     Redmond              CA   98005 False
    0121

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0122
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0123

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0125

    000-
    00-     pp                   pp                        808 555-5555       pp                      pp                   OR   98005 False
    0147
    000-
    00-     •                    •                         808 555-5555       CRAZYINSUN              CRAZYINSUN           CA   20013 False
    0170

    000-
    00-     ••                   •                         808 555-5555       CRAZYINSUN              CRAZYINSUN           CA   20001 True
    0180

    000-
    00-     Walker               Glenn                     808 555-5555       One Microsoft Way       Redmond              CA   98005 True
    0199

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0201

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0232

    000-
    00-     Aoki                 Jack                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0300

    000-
    00-     456Doe               Jack                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0325

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0333

    000-
    00-     Doe                  Jefferson                 808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0350


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (7 of 52) [4/02/2002 8:55:24 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     Venkaesh             Prasad                    808 555-5555       13131310                Hawthorne            CA   98005 False
    0399

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0400

    000-
    00-     Cheney               Richard                   808 555-5555       Executive Building      Washington           CA   98005 True
    0433
    000-
    00-     Rajesh1              krishna                   808 555-5555       Great Indian Desert     southport            CA   56003 False
    0435

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0444

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0456
    000-
    00-     Doe                  Head                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0483

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0500

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0540

    000-
    00-     34543                Jack                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0545

    000-
    00-     Doe                  Joe                       808 555-5555       Two Microsoft Way       Redmond              OR   98111 True
    0550

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0567

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0578

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              IN   98005 False
    0655

    000-
    00-     Eriko                Hidalgo                   808 555-5555       Fuck Taliban            Redmond              CA   98005 False
    0666


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (8 of 52) [4/02/2002 8:55:25 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     V                    T                         555-555-5555       TEST                    TEST                 IN   98005 True
    0678

    000-
    00-     aaron                aaron                     808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0690

    000-
    00-     donald               John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0708
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 True
    0765

    000-
    00-     Anantha              Ram                       123-563-9800       Indian                  Hyderbad             CA   56003 False
    0766

    000-
    00-     Lionel               Aaaaaa                    808 555-5555       Ahhhh                   Redmond              CA   98005 False
    0777
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0789

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0800

    000-
    00-     Doe                  John                      808 555-5555       old man's way           Redmond              CA   98005 False
    0898

    000-
    00-     aabb                 aabb                      808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    0987

    000-
    00-     al Turabi            Devil-Man                 808 555-5555       Slaughter-him-now       Khartoum             MD   98005 True
    0999

    000-
    00-     moran                juliet                    808 555-5555       One Microsoft Way       Redmond              MD   98005 False
    1000

    000-
    00-     pasupuleti           prashant                  40993993290        One Microsoft Way       Redmond              UT   98005 True
    1001

    000-
    00-     Ko                   eeeee                     808 555-5555       One Microsoft Way       Redmond              CA   98005 False
    1002

    000-
    00-     John                 Capsher                   808 555-5555       weeeeeee                C-town               TX   98005 False
    1003


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (9 of 52) [4/02/2002 8:55:25 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1004

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1005

    000-
    00-     Rew                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1008
    000-
    00-     Doe2                 John Black                808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    1110

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1111

    000-
    00-     Cox                  Nobbie                    123 456-7676       One Nobby way hey       Nobbieville           MI   99999 True
    1112
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1116

    000-
    00-     Public               Joe                       123-445-3333       One Microsoft Way       Redmond               CA   98005 False
    1119

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1176

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1212

    000-
    00-     Arthur               Weng                      808 555-5555       One Microsoft Way       Redmond               OR   98005 False
    1233

    000-
    00-     Hanzitest            Hansen                    808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1234

    000-
    00-     Byoungho             Park                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1237

    000-
    00-     Doe2Doe              Johnny                    808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1245

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               OR   98005 False
    1255


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (10 of 52) [4/02/2002 8:55:25 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     fred                 fred                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1258

    000-
    00-     Long                 HeeHaaw                   808 555-5342       Hard Way                Purple Head           CA   98005 False
    1324

    000-
    00-     Tian                 Leo                       777-777-7777       One Microsoft Way       Redmond               UT   98005 True
    1394
    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1500

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1602

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1700
    000-
    00-     ZZZZZZ               ZZZZZZ                    808 555-5555       One Microsoft Way       Redmond               UT   98005 False
    1972

    000-
    00-     Doe                  Zhang                     808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1973

    000-
    00-     Brown                Christian                 3000 0000          Tha knnkl               Redmondnklkn          CA   98005 False
    1984

    000-
    00-     Pdfdsf               Laudfds                   808 555-5555       23, rue de Rans         Fraisans              CA   39700 False
    1999

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2000

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2121

    000-
    00-     Kokulan              Ratnasngi                 808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2154

    000-
    00-     Doe                  John                                         One Microsoft Way       Redmond               CA   98005 False
    2222
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2223


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (11 of 52) [4/02/2002 8:55:25 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     zzzzzzzzzzzzzzz      John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2274

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2323

    000-
    00-     car                  Kara                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2324
    000-
    00-     Doe                  Per                       808 555-5559       One Microsoft Way       Redmond               CA   98009 True
    2555

    000-
    00-     Vladovsky            John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2678

    000-
    00-     Beccar Varela        Marcos                    011 772-1839       One Microsoft Way       Buenos Aires          KS   14263 False
    2728
    000-
    00-     3232                 John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2929

    000-
    00-     Devan                Divine                    717-000-0000       100 Divine Devan Ave.   Cedar Crest           CA   17005 True
    3070

    000-
    00-     Tallada              Pau                       808 555-5555       Petit                   IPC                   PC   98005 True
    3071

    000-
    00-     Doeddd               John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    3243

    000-
    00-     dddd                 John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    3245

    000-
    00-     wowza                wow                       808 555-5555       here                    Redmond               CA   98005 True
    3322

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    3333

    000-
    00-     b                    abeer                     808 555-5555       mof                     Redmond               CA   98005 False
    3635
    000-
    00-     Willie               Slick                     808 555-5555       One Microsoft Way       Redmond               IN   98005 False
    3985


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (12 of 52) [4/02/2002 8:55:25 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     jain                 rajni(My Dolly)           808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4000

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4001

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               MD   98005 True
    4005
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4200

    000-
    00-     Uplny                Jebo z Lesa               123 435-4356       Smetiar 32              Bratislava            CA   81000 False
    4325

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4344
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4345

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4352

    000-
    00-     Doe                  Jack&Jill                 808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4444

    000-
    00-     Ericson              Sven-Gøran                666 444-3333       1 Wembley Way           London                KS   98005 True
    4544

    000-
    00-     Reynolds             Jim                       808 555-5555       One Oracle Way          Euston                CA   98005 True
    4545

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4546

    000-
    00-     Baggosdcsdfsdf       Juju                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4567

    000-
    00-     Mama                 Yo                        808 555-5555       One Microsoft Way       Redmond               UT   98005 False
    4959

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4999


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (13 of 52) [4/02/2002 8:55:25 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    5000

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    5555

    000-
    00-     Doe                  Cret                      808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    6512
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6542

    000-
    00-     Man                  Monkey                    808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6543

    000-
    00-     Peters               sdafgsdagdasg             808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6544
    000-
    00-     Bauers               Angies                    808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6548

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6564

    000-
    00-     XXXXX                XXXXX                     808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6578

    000-
    00-     Hi                   Hi                        805 222 222        Hello                   Redmond               KS   98005 False
    6600

    000-
    00-     Rige                 John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6615

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6656

    000-
    00-     Doexs'               Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6666

    000-
    00-     Doe                  Blake                     808 555-5555       One Microsoft Way       Redmond               MD   98005 False
    6676
    000-
    00-     Chaba                Steve                     808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6969


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (14 of 52) [4/02/2002 8:55:25 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6999

    000-
    00-     R                    Kim                       808 555-7474       One Microsoft Way       Redmond               MI   98005 False
    7474

    000-
    00-     Doe5                 John5                     808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    7532
    000-
    00-     abab                 baba                      808 555-5555       asdfasdfs               Redmond               IN   98005 False
    7676

    000-
    00-     Tester               Beta                      555 555-5555       By The River            Toborville            TN   07734 False
    7734

    000-
    00-     c                    dgfdgdgt                  808 555-5555       One Microsoft Way       Redmond               KS   98005 False
    7777
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    7858

    000-
    00-     Doe111               John1111                  111 555-5555       111111                  1111                  IN   11111 False
    8524

    000-
    00-     dfghdfgh             dfghdfgh                  dfghdfgh           One Microsoft Way       Redmond               CA   98005 True
    8528

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    8550

    000-
    00-     tekinn               cih                       808 555-5555       One Microsoft Way       Redmond               KS   98005 False
    8564

    000-
    00-     Tester               Theo                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    8756

    000-
    00-     jay                  jjj                       808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    8765

    000-
    00-     Tilla                Billa                     808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    8884

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    8888


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (15 of 52) [4/02/2002 8:55:25 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    8976

    000-
    00-     Meay                 Ohii                      956 268-7988       Gere                    ••                    MD   98953 True
    8999

    000-
    00-     Lin                  F.J.                      808 555-5555       One Microsoft Way       Redmond               MI   98005 False
    9000
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9090

    000-
    00-     Doe2                 John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9111

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9123
    000-
    00-     Meoff                Jack                      808 999-2022       Hey Now                 Redmond               CA   98005 False
    9191

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9229

    000-
    00-     KKKKKKKK             KKKKKKKK                  808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    9281

    000-
    00-     pippobhjbjh          ddrtdtrdtrdtrdrtd         808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9568

    000-
    00-     Doeuww               Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9751

    000-
    00-     Testing              Insert                    808 555-5555       555 Test St.            Redmond               IN   98005 True
    9874

    000-
    00-     sss33                John                      808 922-8827       Way                     322                   CA   98005 False
    9878

    000-
    00-     Ivan                 Ivanov                    808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9900
    000-
    00-     pasupuleti           lavanya                   808 555-5553       One Microsoft Way       Redmond               IN   98005 False
    9902


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (16 of 52) [4/02/2002 8:55:25 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    00-     Doer                 Jonathan                  808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9909

    000-
    00-     asasasasasas         Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9926

    000-
    00-     Makoto               Ishida                    808 922877         One Microsoft Way       Redmond               CA   98005 False
    9932
    000-
    00-     Mike                 This is greate!           808 922877         Honolulu                HI                    CA   98005 False
    9933

    000-
    00-     Gavnov               Ivan                      858 555-5555       Two Macrohard No-Way    Pinkmond              CA   92019 True
    9944

    000-
    00-     Gonna Be Die'n       Osama                     808 555-5555       Cave 86                 Effenstan             CA   86868 True
    9956
    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmon                CA   98005 False
    9990

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9991

    000-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               MD   98005 True
    9993

    000-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9999

    000-
    01-     Yu                   Kevin                     780 987-8611       No Microsoft Way        Redmond               CA   98005 True
    0000

    000-
    01-     aydemir              bulent                    542 250-6034       www.101nokta.com        •stanbul              TN   80286 False
    0001

    000-
    01-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1000

    000-
    01-     Cai                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1111
    000-
    01-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1222


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (17 of 52) [4/02/2002 8:55:25 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    01-     Pump                 Bilge                     808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1234

    000-
    01-     Pienescu             Bogdan                    808 555-5555       One Microsoft Way       Bucuresti             se   98005 False
    1974

    000-
    01-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2000
    000-
    01-     ddd                  Bon Bon                   808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2222

    000-
    01-     ALLAN                BALLAN                    808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    9999

    000-
    02-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000
    000-
    05-     Doewq                John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0001

    000-
    07-     Boop                 Betty                     808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    0000

    000-
    08-     Doe                  Johnyuyu                  808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    000-
    09-     Lon                  Bu                        808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    000-
    09-     Mike                 Lazius                    808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    9834

    000-
    10-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    000-
    10-     Bwen                 Gwendon                   123                Testing                 Kansas                KS   10000 False
    0009

    000-
    10-     los                  hji                       808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1546

    000-
    10-     qwq                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9999


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (18 of 52) [4/02/2002 8:55:26 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    11-     aaaaa                John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    000-
    11-     Doery                John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0001

    000-
    11-     KKKKK                PPPPPP                    808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    0010
    000-
    11-     KKKKK                PPPPPP                    808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    0011

    000-
    11-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0450

    000-
    11-     Hi!                  Arash                     808 555-5555       Iran                                          CA   98005 False
    1111
    000-
    11-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1234

    000-
    11-     Dwarf                Dopy                      503 123-8787       Bob way                 Greenland             UT   97321 True
    1299

    000-
    11-     Hi                   How                       808 555-5555       Good                    Redmond               IN   98005 False
    4444

    000-
    12-     Doe                  qw                        808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    000-
    12-     Doe                  John                      808 555-5555                                                     CA   98005 False
    1111

    000-
    15-     Doe                  John                      808 555-5555       One Microsoft Way                             CA   98005 True
    9999

    000-
    20-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    000-
    20-     Bond                 James                     808 555-5555       1 Octopussy Street      Redmond               CA   98005 True
    0007

    000-
    20-     Smith                Fred                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0543


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (19 of 52) [4/02/2002 8:55:26 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    21-     324                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    000-
    21-     Mustermann           Max                       808 555-1111       One Microsoft Way       Redmond               KS   98005 True
    9523

    000-
    22-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000
    000-
    22-                                                                       One Microsoft Way       Redmond               CA   98005 False
    2222

    000-
    25-     Le                   Hanh                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4256

    000-
    26-     Bates                Ron                       808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2626
    000-
    28-     Espa                 Alfonso                   987 654-3210       One Microsoft Way       Redmond •             UT   54321 False
    1000

    000-
    44-     Doen                 John                      808 555-5555       One Microsoft Way       Redmond               KS   98005 False
    0000

    000-
    44-     Doe                  asdfasdfasdf              808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    5555

    000-
    44-     Narayanankutty       Vakkalathu                333 555-5555       A-Way from home         Kerala, India         IN   98005 False
    6666

    000-
    55-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    000-
    55-     blah                 John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1234

    000-
    55-     Dale                 Sides                     808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4239

    000-
    65-     Dover                Ben                       808 555-5555       One Microsoft Way       Redmond               MI   98005 True
    4321
    000-
    66-     Wilson               Bucky                     808 555-5555       123 AnyRoad             SomeWhere             OR   98005 True
    0000


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (20 of 52) [4/02/2002 8:55:26 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    66-     Doe                  Jeff                      800-445-4545       One Microsoft Way       Redmond               CA   98005 True
    1234

    000-
    69-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0069

    000-
    76-     Söderlund            6587675                   000 786-1243       yuoiu                   yoiuyi                CA   65432 False
    1243
    000-
    77-     Lee                  fdsfdsfds                 808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    0000

    000-
    77-                          John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0001

    000-
    77-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    7777
    000-
    78-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    000-
    86-     Deadman              Ima                       808 555-5555       Bin Lyin Low            Lair 29               UT   86868 False
    0000

    000-
    88-     Onur                 gumus                     808 555-5555       One Microsoft Way       Redmond               KS   98005 False
    0000

    000-
    88-     Doe                  Cris                      808 555-5555       One Microsoft Way       Redmond               IN   98005 False
    0654

    000-
    88-     Rumsfeld             Donald                    808 555-5555       White House             Washington DC         IN   98005 True
    1234

    000-
    90-     Dupont               Maurice                   808 555-5555       rue du pont             merac                 TN   98005 True
    0012

    000-
    90-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0098

    000-
    98-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               MD   98005 True
    0000
    000-
    99-     Olsson               Christer                  808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    0000


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (21 of 52) [4/02/2002 8:55:26 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    000-
    99-     kamlakar             madhavi                   808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0034

    000-
    99-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0038

    000-
    99-     2222222              John1111                  808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    8888
    000-
    99-     Doe1                 John2                     808 555-5555       One Microsoft Way       Redmond               KS   98005 True
    8889

    000-
    99-     Peters               Andrew                    808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9999

    001-
    00-     Doe                  Allian                    808 555-5555       One Microsoft Way       Redmond               IN   98001 True
    0000
    001-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0001

    001-
    00-     Michael              Jordan                    800 DIV-ORCE       NO Way                  choongju              CA   98005 False
    0021

    001-
    00-     harvey               John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0125

    001-
    00-     Doe2                 John2                     808 555-5555       One Microsoft Way2      Redmond2              IN   98005 True
    1000

    001-
    00-     Wanker               John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4321

    001-
    00-     Bin Laden            Osama                     1-800-DIG-ME       One Cold Cave           Kandehar              MD   98005 True
    4322

    001-
    01-     Bengal               John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    0000

    001-
    01-     a dob dob            rob                       808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0001
    001-
    01-     sejeong              Lee                       808 555-5555       One Microsoft Way       choongju              CA   98005 False
    0011


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (22 of 52) [4/02/2002 8:55:26 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    001-
    01-     Hunt                 Mike                      800 328-8862       One Bad Chick           Hosebag               CA   06969 False
    4323

    001-
    02-     xian                 Lee                       808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0004

    001-
    02-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2223
    001-
    10-     Doed                 sd                        808 555-5555       One Microsoft Way       Redmond               IN   98005 False
    0100

    001-
    61-     Bengal               Benoit                    808 555-5555       Salut                   Redmond               CA   98005 False
    0000

    001-
    62-     Bengal               Benoit                    808 555-5555       Vive la France          Paris                 CA   98005 True
    0000
    001-
    99-     Ashley               Alex                      808 555-5555       One Microsoft Way       Redmond               MD   98005 False
    0000

    004-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    005-
    00-     Sibal                Pavan                     808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    006-
    88-     George               B.                        440 123-2345       One Middle Road         Elyria                OR   55505 False
    6543

    007-
    00-     S                    Rams                      808 555-5555       great Indian            Bangalore             IN   55555 False
    7007

    007-
    01-     Bellot               Demis                     808 555-5555       The Microsoft Way       Redmond               MI   98005 True
    0070

    007-
    12-     Gulliksen            Paul-Sverre               808 555-5555       One Microsoft Way       Redmond               TN   98005 False
    0050

    009-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               KS   98005 True
    1000
    010-
    00-     Qwerty               Asdf                      808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    0000


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (23 of 52) [4/02/2002 8:55:26 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    010-
    00-     Jones                Ginger                    808 555-5555       One Microsoft Way       Redmond               MD   98005 False
    6666

    010-
    01-     Mister               Jalfrezi                  808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0100

    010-
    01-     Ryan                 John                      808 555-5555       8 Denmark St            Redmond               CA   98005 False
    9999
    010-
    10-     Hammet               Dashell                   808 555-4444       Far away from           Here                  KS   98005 False
    1010

    010-
    20-     Breiling             Noel                      925 287 1513       One Microsoft Way       Redmond               CA   98005 False
    0030

    010-
    60-     Marshall             Vladovsky                 808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    7224
    011-
    00-     Velasquez            Andrea                    808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    011-
    00-     DoeD                 John                      808 555-5555       One Microsoft Wa0       Redmond               CA   98005 False
    0009

    011-
    00-     Valdez               Carina                    808 555-5555       One Microsoft Way       Redmond               MD   98005 True
    1111

    011-
    01-     Doe                  Jo                        808 555-5555       One Microsoft Way       Redmond               IN   98005 False
    9999

    011-
    10-     Doe                  bob                       nunya                                      Austin                TN   98005 False
    0101

    011-
    11-     Men                  Love                      808 555-1111       One Microsoft Way       Redmond               MI   98005 True
    1010

    011-
    11-     ••                   J                         808 555-5555       One Microsoft Way       ••                    IN   98005 False
    9779

    011-
    11-     ••                   J                         808 555-5555       One Microsoft Way       Redmond               IN   98005 False
    9889
    011-
    11-     D                    J                         808 555-5555       One Microsoft Way       Redmond               IN   98005 False
    9999


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (24 of 52) [4/02/2002 8:55:26 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    012-
    03-     X                    Mr.                       000-111-2222       One Microsoft Way       Redmond               CA   98005 False
    0456

    012-
    34-     Kaffenberger         Albert                    415-292-7243       One Microsoft Way       Redmond               CA   98005 True
    5678

    017-
    01-     Butt                 Sumair                    808 555-5555       One Microsoft Way       LA                    CA   98005 True
    0056
    017-
    11-     ddd                  fff                       808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    020-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0001

    020-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1000
    022-
    00-     sac                  sss                       808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0004

    022-
    10-     sac                  sss1                      808 555-5555       One Microsoft Way       Redmond               KS   98005 False
    0004

    023-
    00-     luvin                wookie                    808 555-5555       123 Tatoine             Redmond               CA   98005 False
    0000

    040-
    00-     boccara              ilanit                    808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    0040

    042-
    42-     Thobbe               Rom                       808 555-5555       One Microsoft Way       Redmond               UT   98005 False
    0042

    043-
    85-     Bingo                Boy                       018-424-4113       No Way                  Atlantis              KS   38009 True
    8411

    050-
    00-     ddddd                ccccc                     808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    050-
    06-     abc                  John                      55                 Germany                 Detmold               CA   32760 False
    0000
    056-
    00-     Rudy                 Raul                      808 555-5555       the house on the hill   anytown               UT   98005 True
    7474


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (25 of 52) [4/02/2002 8:55:26 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    056-
    00-     Rudy                 Raul                      808 555-5555       the house on the hill       anytown              UT   98005 True
    9999

    056-
    99-     Rudy                 ^^^^^^^^^^^^^^ 808 555-5555                  the house on the hill       anytown              UT   98005 True
    9999

    060-
    00-     Doe                  John                      808 555-5555       One Microsoft Way           Redmond              CA   98005 True
    0088
    065-
    00-     Lee                  Young                     808 555-5555       One Microsoft Way           Redmond              CA   98005 False
    0000

    065-
    01-                                                    808 555-5555       One Microsoft Way           Redmond              CA   98005 False
    0000

    065-
    02-     leee                 youngg                    808 555-5555       One Microsoft Way           Redmond              CA   98005 False
    0000
    070-
    19-     Pedersen             Brian                     12 23 23 23        Rådhuspladsen 2             Højbjerg             DK   82700 True
    0000

    089-
    70-     asdffgdffghfgh       wdrxfgghfgnvvbn           949578-40684       werwsdffghtyutyihjkjklioo   ererererererererer   MD   98646 True
    5056

    090-
    00-     Smith                Steve                     808 555-5555       One Microsoft Way           Redmond              CA   98005 True
    1111

    090-
    04-     Doe                  John                      808 555-5555       One Microsoft Way           Redmond              CA   98005 False
    6543

    090-
    09-     ABCD                 DCBA                      808 555-5555       One Microsoft Way           Redmond              KS   11111 False
    0909

    090-
    99-     Doe                  John                      808 555-5555       One Microsoft Way           Redmond              CA   98005 False
    0990

    099-
    00-     Toe N Feet           Slap                      808 555-5555       No Way                      Deadmond             wa   98005 False
    9999

    099-
    99-     Doe                  John                      808 555-5555       One Microsoft Way           Redmond              CA   98005 False
    9099

    099-
    99-     Doe                  John                      808 555-5555       One Microsoft Way           Redmond              OR   98005 False
    9999


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (26 of 52) [4/02/2002 8:55:26 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    100-
    00-     Doe2                 Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    100-
    00-     Doe3                 Jack                      808 555-5555       One Microsoft Way       Redmond               IN   98005 True
    0001

    100-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0002
    100-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0008

    100-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0009

    100-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0034
    100-
    00-     Doe                  John                      808 555-5555       One Microsoft Way                             MI   98005 True
    0098

    100-
            Ribeiro
    00-                          Danilo                    111 222-3333       My Address              My City               KS   09110 False
            Gianechini
    0666

    100-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond3              CA   98005 False
    1000

    100-
    00-     tt                   John                      808 555-5555       One Microsoft Way       Redmond               UT   98005 True
    1024

    100-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    7777

    100-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9991

    100-
    02-     lillqvist            dani                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0300

    100-
    10-     Yupid                Es                        808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000
    100-
    10-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               MI   98005 True
    0001


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (27 of 52) [4/02/2002 8:55:26 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    100-
    10-                                                    808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1000

    100-
    20-     Hotzenplotz          Räuber                    0815               Waldweg 13              Spessart City         TN   54321 False
    0300

    100-
    20-     Hotzenplotz          Räuber                    0815               Umlaute äöüÄÖÜß         Spessart City         TN   54321 False
    0301
    100-
    34-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0049

    100-
    50-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    100-
    50-     zimmdude             John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0009
    100-
    55-     XXX                  Mattia                    808 555-5555       One Microsoft Way       Trento,Italy          CA   98005 False
    0000

    100-
    99-     Doe 999              Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    100-
    99-     Shivakumar           Subramaniam               042 952-450        india                   coimbatore            TN   63840 True
    0098

    101-
    01-     Sinatra              Frank                     808 555-5555       One My Way              Or_the_Highway        CA   98005 True
    0101

    101-
    01-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1090

    101-
    11-     gupta                puvvada                   91-040-79901       24-237, MarutiNagar     Secunderabad, AP      IN   50001 False
    1010

    101-
    11-     Hurpskman            Barles                    303 555-5555       One Microsoft Way       Redmond               KS   98005 True
    1111

    102-
    25-     ••••••               ••••••••••                991 040-7990       •••••••••               •••••                 CA   11111 False
    1254
    110-
    00-     Janey                John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0011


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (28 of 52) [4/02/2002 8:55:27 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    110-
    10-     Doe                  John                      808 555-5555       One Microsoft Way        Redmond              CA   98005 False
    1233

    110-
    98-     Doe                  John                      808 555-5555       One Microsoft Way        Redmond              MD   98005 True
    0000

    110-
    99-     Doe                  John                      808 555-5555       One Microsoft Way        Redmond              CA   98005 False
    0099
    111-
    00-     Doe                  Jack                      808 555-5555       One Microsoft Way        Redmond              CA   98005 False
    0000

    111-
    00-     Doe                  John                      808 555-5555       One Microsoft Way        Redmond              CA   98005 False
    0001

    111-
    00-     Doe                  John                      808 555-5555       One Microsoft Way        Redmond              KS   98005 False
    0034
    111-
    00-     Otero                Javi                      808 555-5555       Prueba                   Redmond              CA   98005 False
    0069

    111-
    00-     Ola                  Nordmann                  808 555-5555       One Microsoft Way        Redmond              CA   98005 False
    0300

    111-
    00-     Doe                  John                      808 555-5555       One Microsoft Way        Redmond              CA   98005 False
    1234

    111-
    00-     Doe                  John                      808 555-5555       One Microsoft Way        Redmond              CA   98005 False
    4444

    111-
    00-     Gary                 Preece                    222-222-2222       One Microsoft Way        Redmond              CA   98005 True
    9999

    111-
    01-     Lam                  John                      808 555-5555       One Microsoft Way        Redmond              CA   98005 False
    1234

    111-
    11-     kumar1               vasanth1                  777-999-9456       II floor nelson towers   Zurich               KS   94010 False
    0123

    111-
    11-     Doe                  John                      808 555-5555       One Microsoft Way        Redmond              CA   98005 False
    1000

    111-
    11-     Doe                  Jack                      808 555-5555       One Microsoft Way        Redmond              CA   98005 False
    1111


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (29 of 52) [4/02/2002 8:55:27 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    111-
    11-     Ansari               Najmul                    808 555-5555       Aliganj                    Lucknow            OR   22602 False
    1112

    111-
    11-     hagman               John                      808 555-5555       One Microsoft Way          Redmond            CA   98005 False
    1119

    111-
    11-     Hasan                Atif                      111-222-3333       1574 Irvine Center Drive   Irvine             CA   92782 False
    1123
    111-
    11-     MURAATTTTT           John                      808 555-5555       One Microsoft Way          Redmond            KS   98005 False
    1234

    111-
    11-     Lohan                Harendra                  808 555-5555       One Microsoft Way          Rochester          CA   98005 False
    2222

    111-
    11-     Lohan                Harendra                  2121212            One Microsoft Way          Rochester          CA   98005 False
    2223
    111-
    11-     Doe                  John                      808 555-5555       One Microsoft Way          Redmond            CA   98005 False
    2333

    111-
    11-     Johnson              Tom                       123-123-1234       Down My Street             Da Burg            PA   23462 False
    7892

    111-
    11-     Moreland             Richard                   808 555-5555       One Microsoft Way          Redmond            CA   98005 False
    9898

    111-
    11-     kim                  jazi                      555 555-1212       One Microsoft Way          Redmond            CA   98005 False
    9999

    111-
    12-     •ugugug              jhjklhjklgjkgkj           808 555-5555       One Microsoft Way          Redmond            CA   98005 False
    1234

    111-
    12-     Doe                  John                      808 555-5555       One Microsoft Way          Redmond            CA   98005 False
    2222

    111-
    13-     Wallace              Gromit                    808 000-1111       One Microsoft Way          Redmond            CA   98005 True
    1234

    111-
    22-     Walla                Peter                     808 555-5555       One Microsoft Way          Graz               CA   98005 False
    1111
    111-
    22-     Smith                Emm                       701 555-5555       One Microsoft Way          Redmond            CA   90210 False
    1155


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (30 of 52) [4/02/2002 8:55:27 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    111-
    22-     Wallace              Anna                      800 333-4567       One Microsoft Way         Redmond             TN   98005 False
    1234

    111-
    22-     Doe                  John                      808 555-5555       One Microsoft Way         Redmond             CA   98005 False
    2222

    111-
    22-     Doe                  John                      808 555-5555       One Microsoft Way         Redmond             CA   98005 False
    3331
    111-
    22-     Doe                  Jack                      808 555-5555       Albert                    Austin              OR   98005 False
    3333

    111-
    22-     Paulo                Pereira                   555 555-5555       Rua Tal nº 888            Guaracity           CA   12345 True
    3335

    111-
    22-     Newborn              Pictures                  207 761 0110       http://www.newbornpix.com Portland            OR   04101 True
    3345
    111-
    22-     Doe                  John                      808 555-5555       One Microsoft Way         Redmond             CA   98005 False
    4444

    111-
    22-     D                    D                         808 555-5555       One Microsoft Way         Redmond             CA   98005 False
    5555

    111-
    24-     asdfadsf             asdfadsf                  808 555-5555       One Microsoft Way         Redmond             CA   98005 False
    3434

    111-
    43-     DoeQQQ               Jack                      808 555-5555       One Microsoft Way         Redmond             CA   98005 False
    0454

    111-
    50-     Doe                  John                      808 555-5555       One Microsoft Way         Redmond             CA   98005 False
    0000

    111-
    99-     gggg                 John                      808 555-5555       One Microsoft Way         Redmond             CA   98005 False
    0000

    111-
    99-     Bob                  John                      808 555-5555       One Microsoft Way         Redmond             CA   98005 True
    1234

    111-
    99-     McLaren              Bruce                     666-666-0915       5 Davonshire Drive        Pittsburgh          CA   15238 True
    9999
    112-
    23-     Deere                John                      808 555-5555       One Microsoft Way         Redmond             CA   98005 False
    9783


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (31 of 52) [4/02/2002 8:55:27 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    112-
    23-     Plumb                Adam                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9999

    112-
    55-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6666

    120-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000
    120-
    00-     Doel                 John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1001

    120-
    08-     Busta                Rime                      808 555-5555       One No Way              San Man               KS   98005 False
    0098

    121-
    00-     Xiao                 Be                        808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000
    121-
    10-     Doe                  Vincent                   808 555-5555       One Microsoft Way       Redmond               KS   98005 False
    1989

    121-
    12-     Eperez               eperez                    448410042          Abeto                   SLP                   CA   78130 False
    1212

    121-
    12-     TESTRO               Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    3214

    121-
    22-     Does                 Johns                     808 555-555        One Microsoft Way       Redmond               CA   98005 False
    1133

    121-
    80-     Does                 John23                    2                  One Microsoft Way1      Redmond               CA   98005 True
    5753

    122-
    12-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1212

    122-
    22-     test                 John                      123 123-1233       One Microsoft Way       Redmond               CA   98005 False
    1234

    122-
    32-     akrouk               samer                     808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1111
    123-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (32 of 52) [4/02/2002 8:55:27 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    123-
    00-     pippo                hjbh                      bhjbhj             bhjb                    jhbhj                 CA   98005 False
    0034

    123-
    00-     Joe Smith            Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1111

    123-
    00-     Egil                 Rød                       808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1212
    123-
    00-     Bicalho              Elton                     808 555-5555       Rua tal                 Cuiabá                MD   98005 True
    1234

    123-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    5432

    123-
    06-     van Woudenberg Peter                           808 555-5555       One Microsoft Way       Redmond               IN   98005 False
    4000
    123-
    11-     France               LeoAAAA                   808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1111

    123-
    11-     Kumar                Dilip                     808 555-5555       One Microsoft Way       Redmond               OR   45220 False
    2000

    123-
    12-     Kwoang-Sik           Min                       016 327-5555       One Microsoft Way       Seoul                 CA   98045 False
    0915

    123-
    12-     Doe1                 Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1234

    123-
    12-     Joe                  Blow                      904-555-1212       One Microsoft Way       Redmond               CA   98005 True
    1564

    123-
    12-     Mike                 Nash                      808 555-5555       One Microsoft Way       San Francisco         CA   94105 True
    2345

    123-
    12-     Deleu                Regine                    092 722-3100       Guldensporenpark        Merelbeke             OR   98005 True
    3625

    123-
    12-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6666
    123-
    12-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9999


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (33 of 52) [4/02/2002 8:55:27 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    123-
    16-     leo                  Kats                      816 555-5555       11430Cross              Olathe                KS   66222 False
    7890

    123-
    22-     Gugus                Gaga                      808 555-5555       One Microsoft Way       Redmond               OR   98005 True
    1234

    123-
    33-     Doe                  Jack                      808 555-5556       2 Microsoft Way         Redmond               CA   98005 False
    3243
    123-
    33-     Jain                 Rajesh                    768-098-7868       1, Wood Avenue          Iselin                CA   98005 True
    3456

    123-
    44-     isr                  ww                        999-522-5562       One Microsoft Way       Redmond               OR   98005 True
    4455

    123-
    44-     Doe3                 John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9898
    123-
    45-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    123-
    45-     viswanath            jawalakr                  808-555-4444       One Microsoft Way       Redmond               CA   34534 False
    3678

    123-
    45-     Kamala               Tasha                     919 555-1243       2 Black Dog Way         Kary                  TN   37205 True
    6789

    123-
    45-     dosey do             John                      808 555-5555       One Microsoft Way       ROBERT                CA   98005 False
    6798

    123-
    45-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    7890

    123-
    45-     Engineer             John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    9876

    123-
    55-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    123-
    55-     Rex                  Noah                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0007

    123-
    55-     4                    John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0008


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (34 of 52) [4/02/2002 8:55:27 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    123-
    55-     Thomson              Scott                     654 654-6544       116 Elgin Drive         Brampton              OR   09833 True
    7890

    123-
    59-     floyd                pittman                   808 555-5555       One Microsoft Way       Redmond               CA   33055 False
    6789

    123-
    64-     KKKKK                PPPPPP                    808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    0000
    123-
    64-     KKKKK                PPPPPP                    808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    0001

    123-
    89-     Kevin                Satterthwaite             808 555-5555       12345-12 St             Edmonton              CA   98005 False
    9874

    123-
    90-     Dot Not              Yet                       808 555-5555       Microsoft Cul-de-Sac    Paris                 CA   98005 True
    0000
    123-
    98-     Max                  Tester                    01 12234444        Test                    Sydney                KS   98005 True
    6655

    123-
    99-     Robert               Taylor                    808 555-5555       123 Murdock St.         Marietta              CA   98005 False
    9999

    127-
    85-     Haulund              Jens                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2211

    131-
    31-     Olson                John                      808 555-5555       One Microsoft Way       Redmond               OR   11245 True
    3131

    140-
    09-     Irwan                azam                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0567

    142-
    25-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    3698

    145-
    44-     Doe                  Dil                       808 555-6666       One Microsoft Way       Redmond               CA   98005 False
    7914

    151-
    15-     Doe                                            808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1515
    151-
    15-                                                    808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1516


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (35 of 52) [4/02/2002 8:55:28 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    151-
    15-                                                                       One Microsoft Way       Redmond               CA   98005 True
    1517

    151-
    15-     Mars                 Þ                         808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1518

    154-
    45-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    8798
    168-
    05-     P                    P                         808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    5911

    172-
    32-     White                Johnson                   408 496-7223       10932 Bigge Rd.         Menlo Park            CA   94025 True
    1176

    190-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0001
    190-
    00-     A.P                  Arun                      808 555-5555       4/51 thekkuveedu lane   calicut               CA   98005 False
    0006

    200-
    00-     Dobbs                Bob                       808 555-5555       Church of Subgenious    Slackville            CA   98005 True
    0000

    212-
    77-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4567

    213-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 True
    0002

    213-
    46-     Green                Marjorie                  415 986-7020       309 63rd St. #411       Oakland               CA   94618 True
    8915

    220-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               OR   98005 False
    0000

    222-
    00-     XYZ                  ABC                       123-456-5000       God's way               Redmond               CA   98005 False
    1243

    222-
    12-     Avendaño             Cesar                     907 234-5611       Cra 333 # 111           Medellin              MD   11111 True
    1234

    222-
    12-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    3232


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (36 of 52) [4/02/2002 8:55:28 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    222-
    22-     Doe                  Jack                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2222

    222-
    22-     test1                test2                     416 422-0138       testing address 1       Toronto               OR   91111 True
    2226

    222-
    22-     a                    f                         333 434-3334                               Cleveland             IN   34344 False
    3322
    222-
    22-     a                    f                         333 434-3334       sadfds                  Cleveland             IN   34344 False
    3332

    222-
    88-     ravi                 chand                     808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    2234

    224-
    45-     Pest                 Bug                       616-659-5986       Peach Tree Rd.          Kalamazoo             MI   69582 True
    9875
    230-
    00-     Doesett              Johnathan                 804 555-5544       One Microsoft Ways      gulatan               IN   68005 False
    0300

    232-
    56-     Sexy                 Glamorous                 808 555-5555       Play Boy Mansion        California            CA   98005 True
    5150

    233-
    44-     Alexandre            Jorge                     555 234-4456       Bombarral               Bombarral             KS   25401 False
    5544

    234-
    34-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               KS   98005 False
    3444

    234-
    99-     qqqq                 vvvv                      808 777-4444       P.O. Box 247            seoul                 MD   98555 True
    9999

    238-
    95-     Carson               Cheryl                    415 548-7723       589 Darwin Ln.          Berkeley              CA   94705 True
    7766

    239-
    95-     Someone              aaaaaaa                   808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    7766

    240-
    00-     Greenwood            Seb                       808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    254-
    85-                          John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (37 of 52) [4/02/2002 8:55:28 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    254-
    85-                                                    808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0500

    254-
    85-                                                                       One Microsoft Way       Redmond               CA   98005 False
    8700

    267-
    41-     O'Leary              Michael                   408 286-2428       22 Cleveland Av. #14    San Jose              KS   95128 False
    2394
    269-
    54-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0526

    274-
    80-     HI                   Dean                      415 834-2919       5420 College Av.        Oakland               CA   94609 False
    9391

    300-
    00-     Doe444               John22                    808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0001
    302-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    321-
    18-     xhan2000             John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0231

    321-
    32-     Smith                Joe                       808 555-1234       123 First St.           Baltimore             MD   98005 True
    4321

    321-
    54-     Carboxy              Jack                      +31497123456 Far away                      The Netherlands       Br   98005 False
    0987

    323-
    32-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    3233

    323-
    66-     John                 Doe                       666 999-5555       123 Sesame              San Diego             CA   44444 False
    5432

    324-
    45-     Doet                 John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    4544

    327-
    00-     Balun                Delama                    555 555-5555       Hell's gate Road        Planet Moon           MI   11223 True
    2546
    332-
    00-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (38 of 52) [4/02/2002 8:55:28 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    333-
    00-     LeBlanc              John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    333-
    00-     Simon                Simple                    808 555-5555       One Microsoft Way       Redmond               IN   98003 False
    0001

    333-
    00-     something            John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1111
    333-
    22-     kebeci               Güven                     808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    6666

    333-
    30-     Robinson             John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    3333

    333-
    31-     Lala                 John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    3000
    333-
    33-     kishore              krishna                   808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    1234

    333-
    33-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    3333

    333-
    33-     Çako•lu              Mehmet                    808 555-5555       Thin green mile         istanbul              MD   34400 False
    3399

    341-
    22-     hey                  Meander                   913 843-0462       10 Mississippi Dr.      Lawrence              KS   66044 True
    1782

    343-
    33-     Tang                 Putti                     808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    345-
    67-     xxx                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    348-
    88-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    3874

    355-
    76-     Jim                  Rieck                     8476959476         One Microsoft Way       Redmond               CA   98005 False
    5317

    357-
    27-     Doe                  lklll                     808 555-5555       One Microsoft Way       ond                   IN   98005 True
    9870


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (39 of 52) [4/02/2002 8:55:28 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    357-
    27-     Doe                  lklll                     312-555-5555       One Microsoft Way       ond                   IN   98005 True
    9873

    366-
    26-     LaForge              Geordi                    1-800-STA-RS       One Microsoft Way       Franklin              TN   37067 True
    8404

    378-
    87-     Doe                  John                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    8737
    394-
    00-     Lazius               Mike                      808 555-5555       One Microsoft Way       Redmond               UT   98005 True
    9374

    395-
    26-     Capsher              John                      987 654-3210       1212 Loop 12            Dallas                OR   98005 False
    2222

    399-
    99-     pippi                calzelunghe               808 555-5555       One Microsoft Way       San francisco         CA   14725 False
    3999
    400-
    00-     Yo                   YoYo                      808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0077

    409-
    56-     john                 Abraham                   415 658-9932       6223 Bateman St.        Berkeley              CA   94705 False
    7008

    427-
    17-     DullnDumb            Ann                       415 836-7128       3410 Blonde St.         Palo Alto             CA   94301 True
    2319

    432-
    00-     Anka                 Kalle                     808 555-5555       One Microsoft Way       Redmond               CA   98005 False
    0000

    440-
    90-     Pegg                 Jeffrey                   918 361-7344       2448 E 81st             Tulsa                 OR   74137 True
    7785

    443-
    00-     Beee                 WHO                       22222222           2223 dfdsf              Redmonds              KS   98004 True
    0001

    443-
    23-     Hard                 Rock                      696 969-6969       One Stiff Way           peters town           Co   69696 False
    5543

    444-
    44-     Tomaylla             Juan                      808 555-5555       24 Blue Mont Av.        Miami                 CA   98005 True
    4444

    445-
    00-     Hunter               John                      808 555-5555       One MS Way              Redmond               CA   98005 True
    0055


http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx (40 of 52) [4/02/2002 8:55:28 AM]
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/data/VB/datagrid4.aspx
    446-
    44-     Channe               Jaishri                   111 111-1111       Park Chambers, Regopark   Beverly             IN   99345 True
    4447

    454-
    21-     V. Will              Rockyou                   808 555-5555       D. EBERLE                 BIRKENFELD          D    00000 True
    3478

    454-
    21-     Smith                John                      808 555-5555       One Microsoft Way         Redmond             UT   98005 True
    8465
    456-
    99-     DoeEx                JohnEx                    808 555-5555       One Microsoft Way         Redmond             CA   98005 True
    0000

    472-
    27-     Gringlesby           Burt                      707 938-6445       PO Box 792                Covelo              CA   95428 True
    2349

    486-
    29-     Locksley             Charlene                  415 585-4620       18 Broadway Av.           San Francisco       CA   94130 True
    1786
    500-
    00-     Subram               John                      808 555-5555       One Microsoft Way         Redmond             CA   98005 False
    0092

    527-
    72-     Greene               Morningstaruuuu           615 297-2723       22 Graybar House Rd.      Nashville           TN   37215 False
    3246

    555-
    00-     Does                 Johns                     808 555-5555       One Microsoft Way         Redmond             CA   98005 True
    5555

    555-
    11-     Bin Laden            Osama                     (000) 000-00       Cave 23                   Tora Bora           UT   00000 False
    2222