Course 2310: Unlock the Secrets of ASP.NET Web Applications by Using Visual Studio .NET

By Ian Matthews, MCSE

Published: July 31, 2002 | Updated: July 13, 2007

On This Page
What you will learnWhat you will learn
What is in ASP.NETWhat is in ASP.NET
Creating an ASP.NET Web applicationCreating an ASP.NET Web application
Accessing data and using XMLAccessing data and using XML
Adding functionality and completing your applicationAdding functionality and completing your application
A sample lesson: code-behind pagesA sample lesson: code-behind pages
Start building your skills todayStart building your skills today
Additional resourcesAdditional resources

Microsoft .NET opens up a whole new world of possibilities for Web development. Microsoft ASP.NET and ADO.NET represent entirely new paradigms for creating dynamic, interactive, and data-rich Web sites. If you are going to develop applications for the Web, you should know how to develop with .NET.

ASP.NET represents a major leap forward from Active Server Pages (ASP). ASP.NET is fully supported in Microsoft Visual Studio .NET. This support enables you to build Web applications with far less code and effort than with ASP. Some of the benefits that ASP.NET provides to developers:

Full access to the Microsoft .NET Framework classes.

The ability to call XML Web services directly, without needing to know the details of the Simple Object Access Protocol (SOAP).

The ability to code in any .NET language, not just VBScript or JScript.

ASP.NET also offers many enhancements, and some of these are:

Automatic recovery from errors and memory leaks—without rebooting.

Automatic recompilation of updated Web pages.

Sharing of session state across all servers in a Web farm.

Support for various mobile device platforms, without having to write any custom code.

Support for deployment of updated components by replacing existing ones, without stopping the Web server.

The ability to run side by side with existing ASP applications.

Better performance than ASP.

ADO.NET works with ASP.NET to give your Web applications seamless data access by using a unified object model that works the same for any data source, so you never need to customize your code to change databases. The data objects of ADO.NET, such as the DataSet object, are loosely coupled so that they are ideally suited to serve data through Web applications. ADO.NET is built on XML and uses XML as its native data format. You can easily move data in and out of different sources and display it any way you like.

Course 2310: Developing Microsoft ASP.NET Web Applications Using Visual Studio .NET is the Microsoft Official Course that gives you the specific skills you need to develop .NET-based Web applications with ASP.NET and ADO.NET. Assuming that you begin the course with some basic HTML skills, you will finish with a detailed understanding of:

How to create Web applications and XML Web services by using Visual Studio .NET.

How ASP.NET and ADO.NET work.

How to use ASP.NET and ADO.NET to build controls and access data.

How to work with XML data.

What you will learn

Course 2310 is aimed at the beginning Web developer. The course requires a basic understanding of Microsoft .NET and one of the .NET languages (either Microsoft Visual Basic .NET or Visual C#). Consider taking the following Microsoft Official Courses to help you gain the prerequisite skills required for Course 2310:

Course 2559: Introduction to Visual Basic .NET Programming with Microsoft .NET.

or

Course 2609: Introduction to C# Programming with Microsoft .NET. These courses are designed to give novice programmers, or those with limited experience developing for a graphical environment, an introduction to using Visual Basic .NET or Visual C# and the Visual Studio .NET environment. (See my article on Course 2559.)

Course 2373: Programming with Microsoft Visual Basic .NET.

or

Course 2124: Programming with C#. These courses are targeted at experienced developers who want to upgrade their skills to either Visual Basic .NET or Visual C#. Topics covered include the new features and syntax of the language, an introduction to .NET, and upgrading existing applications to .NET.

Top of pageTop of page

What is in ASP.NET

Modules 1 through 3 in Course 2310 help you to get your bearings with .NET. In these modules you learn:

The basic concepts behind .NET and how ASP.NET fits into it.

How Visual Studio .NET works with .NET.

How to use the Visual Studio .NET development environment.

How to create your first Web application.

What the various languages in Visual Studio .NET are all about.

The accompanying labs get you right into the course. First, you explore the Visual Studio .NET environment. Then, you create an ASP.NET Web application, create a class, and call the class by using Visual Basic .NET.

Top of pageTop of page

Creating an ASP.NET Web application

Beginning with Module 4, in which you create your first ASP.NET page, you begin Web application development in earnest. In this module you learn how to add controls to a Web form and compile your ASP.NET application. In Module 5, you advance to adding code and learning the importance of code-behind pages (see A sample lesson: code-behind pages in this article). In this module, you also learn how to handle events and add event procedures to your server controls. Modules 6 and 7 cover debugging and validating user input. Finally, in Module 8 you learn how to create user controls, which are custom user interface (UI) components that you build yourself so that you can reuse them wherever you see fit.

The example application that you create for this course is a company benefits Web site that displays employee benefits and lets employees set up their benefits. In Lab 4, you create the default .aspx page for this Web site by building the main Web form and the life insurance Web form and then populating these forms with controls to build the user interface. In Labs 5 and 7, you add event procedures and validate user input. In Lab 8, you create a user control to accept the employee's name and the date, and then place the user control on the medical insurance form.

Top of pageTop of page

Accessing data and using XML

In Modules 9 through 12, you learn how to access data in .NET. First, you use Visual Studio tools to create data connections. Then, you learn how to use ADO.NET data access objects, such as the DataSet object, to create, read, update, and delete records in a data source through your Web application. You also see how to access Microsoft SQL Server stored procedures through ADO.NET. In Module 12, you learn how to access and use XML data in an ASP.NET Web form.

In Lab 9, you work directly with data to add doctor selection functionality to the medical insurance form. First, you create a SQL connection with a simple drag-and-drop operation. Then, you define a DataSet object to pull the data from the database and add a DataGrid to display the data. You can then page through the data and update it: All of your basic functionality is automatically available. In Lab 10, you add a drop-down list populated with cities from the doctors database and learn much more about ADO.NET coding. In Lab 11, you advance to calling SQL stored procedures through ADO.NET commands. Finally, in Lab 12, you learn how to access data directly in XML and apply Extensible Stylesheet Language (XSL) style sheets to the data to display prospectuses for the employee retirement plan choices.

Top of pageTop of page

Adding functionality and completing your application

Modules 13 through 16 complete the ASP.NET application development picture. In Module 13, you work with XML Web services, learning how to create and use one in your Web application. In Module 14, you learn how to manage state—the application and session data you need to track—and how to store and track it. Module 15 covers configuration and deployment of your ASP.NET application. Finally, Module 16 explains security issues.

In Lab 13, you create an XML Web service to pull a list of dentists, and then consume that service to display the dentists on the benefits Web site. In Lab 14, you learn to track user sessions with session variables and cookies. In Lab 15, you cache all or part of your Web application in addition to deploying it on a Web server. To conclude, Lab 16 shows you how to set up Windows-based or forms-based authentication.

Top of pageTop of page

A sample lesson: code-behind pages

One of the chief innovations of ASP.NET is the use of code-behind pages. Code-behind pages address a major challenge with ASP development: Because ASP script code is embedded in the same document as the HTML, it can be difficult to have multiple developers working on code or to track their revisions. When using code-behind pages in ASP.NET, you place all of your code in a separate file, thus separating the UI elements from your application or business logic. The implication here is that, in a large application project, the designer and the programmer can independently and in parallel develop the UI design and the underlying application logic. This innovation is a great help to application development teams.

The following sample lesson from Course 2310 shows how code-behind pages work:

Code-behind pages contain all of the programming logic for a single Web page. Each Web page in a Web application has its own code-behind page. By default, a code-behind page has the same name as the Web page with which it is associated; however, the code-behind page also has an .aspx.vb or .aspx.cs extension, depending on the language used in the code-behind page. For example, the Web page Form1.aspx will have a Microsoft Visual Basic .NET code-behind page named Form1.aspx.vb or a C# code-behind page named Form1.aspx.cs.

This is the default method for managing code in a Web application; unless you specify otherwise, Visual Studio does this automatically for you. To ensure compatibility, Visual Studio still lets you insert ASP.NET code directly into your .aspx page, but this is not recommended. When Visual Studio .NET creates the code-behind page for you, it adds attributes to the @ Page directive in the .aspx file to link it to its code-behind page.

The following is a sample from the course materials:

Visual Basic .NET

The @ Page directive in this sample includes three parameters to implement code-behind pages:

<%@ Page Language="vb" Inherits="Project.WebForm1" Codebehind="Page1.aspx.vb" Src="Page1.aspx.vb" %>

Inherits: Specifies which classes and objects the .aspx page inherits from its code-behind page.

Codebehind: Supplies the name of the code-behind page, which Visual Studio .NET uses to associate the two files for the page during precompilation.

Src: Provides the source file name for the code-behind page and is used when the application is not precompiled but is left to compile just in time when the page is first accessed. Visual Studio does not add the Src attribute by default. If you leave the Src attribute out of the directive, the page will be precompiled when you build your Web application.

Pre-compiling is often desirable because it saves processing time on the server during live operations. Also, you do not have to push both the .aspx and the .vb or .cs page live at the same time. The compiled version of the page combines the information from both the .aspx and the .vb or .cs files.

Top of pageTop of page

Start building your skills today

Course 2310: Developing Web Applications Using Microsoft Visual Studio .NET demonstrates that Visual Studio .NET makes it easy to build dynamic, data-rich, and complex Web applications. The content developers of this course include experienced professional developers, Microsoft Certified Trainers, and instructional designers. Their combined expertise ensures course content of the highest quality, relevant and appropriate for students meeting the prerequisites. In addition to writing the content, the content developers created labs to let you apply your newly learned skills to practical, real-world problems.

By the time you have completed this course, you will have created your own ASP.NET application, including Web Forms and controls, data access, and XML Web services. You will know how to debug and trace through your application, validate user input, and deploy your application and help enhance its security.

The skills and knowledge you gain can lead to a career in professional Web development leveraging your proficiency with the next great Web development platform and toolset. Course 2310 also helps you to acquire some of the skills you need to attain the Microsoft Certified Application Developer (MCAD) credential. You will keep your course materials so that you can refer to them in other courses and on the job.


Course 2310 and other Official Microsoft Learning Products are available through Microsoft Certified Partner(s) for Learning Solutions programs. These courses are taught by Microsoft Certified Trainers (MCTs) who have achieved Microsoft's premier credentials. In addition, Microsoft Certified Partner(s) for Learning Solutions programs offer state-of-the-art facilities and are required by Microsoft to meet certain criteria before they can deliver Official Microsoft Learning Products.

Top of pageTop of page

Additional resources

Learn more about ASP.NET, Course 2310, and other related topics.


Top of pageTop of page