שתף באמצעות


ASP.NET Walkthroughs by Scenario

This topic lists a selection of walkthroughs (tutorials) that introduce you to Web development concepts in ASP.NET. These walkthroughs also cover Web development features in Visual Studio 2010 and Visual Web Developer 2010 Express (collectively referred to as Visual Studio).

In addition to these walkthroughs, many topic sections in the Visual Studio documentation include walkthroughs that illustrate key features.

This topic contains the following sections:

  • Basic Walkthroughs

  • Debugging and Testing Web Sites

  • Creating Web Site Navigation

  • Designing the Look and Layout of a Web Site

  • Designing Web Sites for Accessibility

  • Securing Access to a Web Site and Tracking Per-User Information

  • Accessing Data

  • Using ASP.NET MVC to Create Web Applications

  • Using Dynamic Data to Create Data-Aware Web Sites

  • Using Microsoft Ajax and Client Scripting

  • Creating Web Pages for an International Audience

  • Publishing (Deploying) a Web Site

  • Creating Custom Web Site Components

Basic Walkthroughs

The following table lists walkthroughs that introduce you to ASP.NET and Visual Studio, and are particularly useful if you are new to ASP.NET Web development.

Topic

Description

Introduction: Planning an ASP.NET Web Site

Provides an overview of the factors that you should consider when you design a Web site. The topic provides links to topics that provide additional information about individual subjects.

Walkthrough: Creating a Basic Web Page in Visual Studio

Shows how to use Visual Studio to create an ASP.NET Web site that contains a simple page. You will learn how to create a new ASP.NET Web site project, how projects are laid out, how to add pages, and how to test a Web site. 

Walkthrough: Code Editing in Web Pages in Visual Studio

Shows how to use the code editor. Some of the features of the code editor depend on what language you are coding in. Therefore, in this walkthrough you create two pages, one that uses Visual Basic and another that uses C#.

Walkthrough: Creating a Basic Web Page with Code Separation in Visual Studio

Shows how to create Web pages in Visual Studio. It guides you through creating a simple page, illustrating the basic techniques of creating a new page, adding controls, and writing code.

Walkthrough: Using HTML Snippets

Show how to add markup to a page by using code snippets. You can use HTML code snippets in Visual Studio to save time and reduce the amount of typing you have to do. 

Walkthrough: Validating User Input in a Web Forms Page

Shows how to use ASP.NET validation controls to automatically check user input in a Web page.

Walkthrough: Using Output Caching to Enhance Web Site Performance

Shows how to use output caching, which uses a pre-processed copy of a page instead of processing the page again for each request.

Walkthrough: Caching Application Data in ASP.NET

Shows how to cache application data in an ASP.NET application. Uses the caching API that is available in the System.Runtime.Caching namespace.

Debugging and Testing Web Sites

You can use the Visual Studio debugger to help locate errors in your code. ASP.NET tracing lets you display processing steps that occur while a page runs.

Note

The ASP.NET MVC framework provides extensive support for unit testing and test-driven development.

Topic

Description

Walkthrough: Debugging Web Pages in Visual Web Developer

Shows how to use the Visual Studio debugger to work with ASP.NET Web pages.

Walkthrough: Using Tracing in Visual Web Developer to Help Find Web Page Errors

Shows how to use tracing in an ASP.NET Web page to find errors. Tracing displays messages about the actions that occur during page processing.

Creating Web Site Navigation

The following table lists walkthroughs that show you how to create navigation in your Web site in the form of menus, site maps, and so on.

Topic

Description

Walkthrough: Displaying a Menu on Web Pages

Shows how to add a menu control to a page and use it as a navigation tool.

Walkthrough: Adding Site Navigation to a Web Site

Shows how to create site navigation by using navigation controls such as the Menu control, the TreeView control, and the SiteMapPath control, which adds a navigation path to Web pages.

Walkthrough: Using ASP.NET Routing in a Web Forms Application

Shows how to design URLs that have meaningful information for users and that are help with search engine optimization (SEO).

Designing the Look and Layout of a Web Site

The following table lists walkthroughs that illustrate how to create the layout and look of your ASP.NET Web sites.

Topic

Description

Walkthrough: Creating and Modifying a CSS File

Introduces the features of Visual Studio for working with cascading style sheets (CSS). The walkthrough guides you through creating a three-column page layout, illustrating the basic techniques of creating a new Web page and a new style sheet.

Walkthrough: Customizing a Web Site Using Themes in Visual Studio

Shows how to use themes to apply a consistent look to pages and controls in a Web site.

Walkthrough: Creating User-Selectable Themes

Shows how to create an ASP.NET page that lets users select a theme for the page. Although this example uses a single control skin and a basic cascading style sheet (CSS) file, the principles shown apply to more complex themes that include graphics, different layout schemes in the CSS file, and more complex server control skins.

Walkthrough: Creating and Using ASP.NET Master Pages in Visual Web Developer

Shows how to create a master page and several content pages. Master pages let you create a page layout. You can then create separate pages that contain content that is merged with the master page at run time.

Walkthrough: Using Nested Master Pages in ASP.NET

Shows how to nest master pages so that the parent master page provides a consistent layout throughout a Web site, and the child master page can be used as a template for consistent layout within the parent master page.

Designing Web Sites for Accessibility

Accessibility standards define how to build Web pages that can be used by people who have disabilities. The following walkthroughs show some techniques that help you create ASP.NET Web sites that conform to accessibility standards.

Topic

Description

Walkthrough: Accessibility Guidelines for Using Image Controls, Menu Controls, and AutoPostBack

Shows how to use Image controls, Menu controls, and the ASP.NET AutoPostBack feature in ways that conform to accessibility standards.

Walkthrough: Accessibility Guidelines for Using the GridView Control

Shows how to display data by using GridView controls in ways that conform to accessibility standards.

Walkthrough: Accessibility Guidelines for Using the ListView Control

Shows how to display data by using ListView controls in ways that conform to accessibility standards.

Walkthrough: Accessibility Guidelines for Using Nested ListView Controls

Shows how to display complex data by using nested ListView controls in ways that conform to accessibility standards.

Walkthrough: Accessibility Guidelines for Using Label Controls, Validator Controls, and Panel Controls

Shows how to use Label controls, validator controls, and Panel controls (div elements) in an input form in ways that conform to accessibility standards.

Securing Access to a Web Site and Tracking Per-User Information

In many cases, you want to restrict access to pages in a Web site so that only users who are logged on can use those pages. You can also configure your site so that it can store information about preferences and other per-user data, even if users do not have a user ID for your site.

Topic

Description

Walkthrough: Creating an ASP.NET Web Site with Basic User Login.

Shows how to use the built-in ASP.NET Web Site project template to create a Web site that has basic login functionality.

Walkthrough: Creating a Web Site with Membership and User Login

Shows how to use ASP.NET controls and ASP.NET membership services to create custom pages that let users log in and work with member-only pages.

Walkthrough: Managing Web Site Users with Roles

Shows how to assign users to roles and how to create rules (permissions) that selectively grant or deny access to pages for different roles. It also shows how to programmatically determine whether a user is in a particular role and which roles the current user is in.

Walkthrough: Maintaining Web Site User Information with Profile Properties

Shows how to add profile properties to a Web site that lets you create a personalized experience for visitors and keep track of details for individual users.

Accessing Data

The walkthroughs listed in the following table teach you how to create ASP.NET Web pages that display data and that let users edit data.

Topic

Description

Walkthrough: Basic Data Access in Web Pages

Shows how to create a simple data-bound page by using controls that are designed specifically for data access.

Walkthrough: Creating Master/Detail Web Pages in Visual Studio

Shows various ways to work with data in multiple controls and from multiple tables, which includes those that have a master/detail relationship.

Walkthrough: Creating the Data Access and Business Logic Layers in ASP.NET

Shows a simple example of best practices for creating a Web site that accesses a database by isolating the data-access and business-logic layers.

Walkthrough: Displaying, Paging, and Sorting Data Using the ListView Web Server Control

Shows how to work with the ListView control, which provides powerful and flexible ways for you to define how data is displayed.

Walkthrough: Modifying Data Using the ListView Web Server Control

Shows how to display and update data in the ListView control. This walkthrough uses a SqlDataSource control to retrieve results from a SQL Server database and to manage updates.

Walkthrough: Simple Sorting for the GridView Web Server Control

Shows how to use the ASP.NET GridView control's built-in sort functionality to add single-column sorting to data display without requiring any coding.

Walkthrough: Displaying a Drop-Down List While Editing in the GridView Web Server Control

Shows how to enhance data editing in the ASP.NET GridView control by customizing the control to use a drop-down list in place of a text box.

Walkthrough: Retrieving, Updating, Inserting, and Deleting Data with the LinqDataSource and DetailsView Controls

Shows how to create a simple database table and a Web page that uses LINQ queries The Web page enables users to retrieve, update, insert, and delete data from the database table.

Walkthrough: Displaying Hierarchical Data in a TreeView Control

Shows the basics of how to use the TreeView control to display hierarchical data. The TreeView control is suitable for displaying XML data, but can be used for any data that can be represented in a hierarchy.

Walkthrough: Filtering Data in a Web Page Using Declarative Syntax

Show how to use the ASP.NET QueryExtender control in the markup of a Web page to filter data by using only declarative syntax.

Walkthrough: Making Data-Bound Controls Easier to Access from JavaScript

Shows how to configure the ClientID property of a control so that you can write client script that updates specific items on a page that display data.

Using ASP.NET MVC to Create Web Applications

The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model (data), the view (UI), and the controller (business and domain logic). The ASP.NET MVC framework is a lightweight, highly testable presentation framework that is integrated with ASP.NET features such as master pages and membership-based authentication.

Topic

Description

Walkthrough: Creating a Basic MVC Project with Unit Tests in Visual Studio

Shows how to create an ASP.NET MVC Web application, and shows how to use a unit-test framework and add a test project to an ASP.NET MVC project.

How to: Validate Model Data Using DataAnnotations Attributes

Shows how to use data annotations to validate data.

Walkthrough: Adding ASP.NET AJAX Scripting to an MVC Project

Shows how to add client-side processing to views in an MVC application.

Walkthrough: Organizing an ASP.NET MVC Application using Areas

Shows how to create a MVC project with multiple areas.

Using an Asynchronous Controller in ASP.NET MVC

Shows how to use asynchronous controller methods.

Using Dynamic Data to Create Data-Aware Web Sites

ASP.NET Dynamic Data lets you create extensible data-driven Web applications by inferring at run time the appearance and behavior of data entities from the database schema and deriving UI behavior from it. Dynamic Data enables you to create a data-driven Web site with little or no coding by analyzing your data model and generating UI from it.

Dynamic Data supports scaffolding, which is a way to automatically generate Web pages for each table in the database. Scaffolding lets you create a functional Web site for viewing and editing data based on the schema of the data. You can also enable dynamic behavior in existing or new Web applications without using scaffolding.

Topic

Description

Walkthrough: Creating a New Dynamic Data Web Site Using Scaffolding

Shows how to create a basic Web site that uses ASP.NET Dynamic Data.

Walkthrough: Adding Dynamic Data to Existing ASP.NET Web Sites

Shows how to create a Web site to include Dynamic Data framework features. In addition, this walkthrough shows ways in which you can customize the Dynamic Data Web site capabilities.

Walkthrough: Enabling Dynamic Data in ASP.NET Data-Bound Controls

Shows how to enable dynamic behavior in ASP.NET data-bound controls without using Dynamic Data scaffolding.

Walkthrough: Customizing Data Field Appearance and Behavior in the Data Model

Shows how to customize the way in which Dynamic Data displays data from a data field.

Walkthrough: Customizing Table Layout Using Entity Templates.

Shows how to customize the way in which Dynamic Data displays data from a table.

Walkthrough: Filtering Rows in Tables That Have a Parent-Child Relationship

Shows how to perform table-row filtering in an ASP.NET Dynamic Data Web site.

Walkthrough: Mapping Table-per-Hierarchy Inheritance in Dynamic Data.

Shows how to implement table-per-hierarchy (TPH) inheritance by modifying the conceptual model in an Entity Data Model (EDM).

Using Microsoft Ajax and Client Scripting

Microsoft Ajax enables you to quickly create Web pages that include a rich user experience with responsive and familiar user interface (UI) elements. Microsoft Ajax includes client-script libraries that incorporate cross-browser ECMAScript (JavaScript) and dynamic HTML (DHTML) technologies. By using Microsoft Ajax, you can improve the user experience and the efficiency of your Web applications.

The following walkthroughs focus on enhancing server-based ASP.NET Web Forms applications using Ajax technology.

Topic

Description

Walkthrough: Creating an Ajax-Enabled Web Site

Shows how to use some features of Microsoft Ajax that are included when you install Visual Studio.

Walkthrough: Creating an Ajax-Enabled Data Application

Shows how to create an AJAX-enabled Web application that can work as a to-do or task list.

Walkthrough: Globalizing a Date by Using Client Script

Shows how to use ECMAScript (JavaScript) to display days, months, and other date-related values in globalized formats.

Walkthrough: Embedding a JavaScript File as a Resource in an Assembly

Shows how to include a JavaScript file as an embedded resource in an assembly.

Walkthrough: Embedding Localized Resources for a JavaScript File

Shows how to include an ECMAScript (JavaScript) file as an embedded resource in an assembly, and how to include localized strings for use in the JavaScript file.

Walkthrough: Adding Localized Resources to a JavaScript File

Shows you how to include localized resources in an ECMAScript (JavaScript) file.

Walkthrough: Making Controls Located in Web User Controls Easier to Access from JavaScript

Shows how to configure the ClientID property of a control so that you can write client script that accesses ASP.NET controls in a user control.

Creating Web Pages for an International Audience

ASP.NET lets you create a single Web page that can display text in different languages, according to information that comes from the user. The translated (localized) text is stored in resource files that can be automatically read by ASP.NET when a page runs.

Note

For a list of walkthroughs that show how to use JavaScript to create Web pages for an international audience, see Using Microsoft Ajax and Client Scripting in this document.

Topic

Description

Walkthrough: Using Resources for Localization with ASP.NET

Shows how to create localization resource files and reference them in Web pages by using declarative expressions.

Publishing (Deploying) a Web Site

After you have created and tested a Web site, you typically publish it to a server computer. The walkthroughs in this section show you features in Visual Studio that let you deploy your Web site for others to use.

Topic

Description

Walkthrough: Deploying a Web Site Project by Using the Copy Web Site Tool

Shows how to use the Copy Web Site tool to copy files between your Web site project and a Web site using an FTP-like utility. (Does not apply to Web application projects. For information about the differences between Web site projects and Web application projects, see Web Application Projects versus Web Site Projects.)

Walkthrough: Deploying a Web Site Project by Using XCOPY

Shows how to use the Windows XCOPY command to copy files from your Web site project to a Web site. (Does not apply to Web application projects.)

Walkthrough: Deploying a Web Site Project by Using the Publish Web Site Tool

Shows how to use the Publish Web Site utility to compile a Web site project and then copy the output to an active Web site. (Does not apply to Web application projects.)

Note

The Publish Web Site utility is not available in Visual Web Developer 2008 Express Edition or later versions of Visual Web Developer Express.

Walkthrough: Deploying a Web Application Project Using One-Click Publish

Shows how to deploy a Web application project to a hosting company by using one-click publish. (Does not apply to Web site projects.)

Walkthrough: Deploying a Web Application Project Using a Web Deployment Package (Part 1 of 4)

Provides the first in a series of four walkthroughs that show how to deploy a Web application project by creating and installing a deployment package. The walkthroughs illustrate both local and remote deployment. (Does not apply to Web site projects.)

Creating Custom Web Site Components

ASP.NET includes a rich array of features for creating Web pages, but it is also highly extensible. The walkthroughs in this section illustrate advanced ASP.NET functionality, such as how to create custom ASP.NET controls that encapsulate HTML and logic, how to create custom Web output such as RSS, and how to create components that monitor and respond to HTTP requests to your site.

Topic

Description

Walkthrough: Creating Reusable Elements with ASP.NET User Controls

Shows how to encapsulate markup and code into an ASP.NET user control that you can add as a reusable element to any ASP.NET Web page in a site.

Walkthrough: Using Shared Code in Web Sites in Visual Web Developer

Shows how to create a class that can be referenced automatically anywhere in your Web site. Creating shared classes is a powerful way to manage business logic and to create reusable components in Web applications.

Walkthrough: Developing and Using a Custom Web Server Control

Shows how to create and compile a custom ASP.NET server control and use it in a page.

Walkthrough: Creating a Synchronous HTTP Handler

Shows how to create an HTTP handler, which lets you create custom dynamic output other than Web pages, such as RSS feeds.

Walkthrough: Creating and Registering a Custom HTTP Module

Shows the basic functionality of a custom HTTP module. An HTTP module is called on every request, and lets you customize how the request or response is processed.

See Also

Concepts

ASP.NET Overview

Web Application Projects versus Web Site Projects