This documentation is archived and is not being maintained.

Web Forms Pages and Projects in Visual Studio

Web Forms pages are one way to create the user interface of an ASP.NET-based Web application. You can add Web Forms pages to several types of Visual Studio projects. Most often, when you want to work with Web Forms pages, you will use the ASP.NET Web Application project template. For more information on Web project templates, see Introduction to Web Projects. For information on ASP.NET Web applications as a whole, see Introduction to ASP.NET Web Applications in Visual Studio.

To work with a Web Forms page in Visual Studio, you use the Web Forms Designer. The designer includes a WYSIWYG view, called Design view, for laying out the elements of the page. Alternatively, you can switch the designer to HTML view, which gives you direct access to the ASP.NET syntax of the elements on the page. Finally, the designer includes a code editor with Intellisense that you can use to create the page initialization and event handler code for your page. For more information, see Introduction to Web Forms Pages.

Project Files Created With Web Forms

When you create a Web project, Visual Studio constructs a Web application directory structure on the target Web server, and a project structure on your local computer. The files that relate to your Web Forms pages are as follows:

Note   You need to have appropriate privileges on the Web server computer to create and manage Web application files. The correct way to get those privileges is to be a member of the VS Developers group that is automatically created on the Web server. For details, see Web Application Security at Design Time in Visual Studio.
File CreatedDescription
WebForm1.aspx and WebForm1.aspx.vb files

(or WebForm1.aspx.cs for Visual C# Web applications)

These two files make up a single Web Forms page. The .aspx file contains the visual elements of the Web Forms page, for example HTML elements and Web Forms controls. The WebForm1.aspx.vb class file is a hidden, dependent file of WebForm1.aspx. It contains the code-behind class for the Web Forms page, containing event-handler code and the like. For more information see Web Forms Code Model.
AssemblyInfo.vb (for Visual Basic projects)

or AssemblyInfo.cs (for C# projects)

A project information file (AssemblyInfo.vb or AssemblyInfo.cs file) that contains metadata about the assemblies in a project, such as name, version, and culture information. For details on data contained in the assembly file, see Assembly Manifest.
Web.configAn XML-based file that contains configuration data on each unique URL resource used in the project. For more information see Application Configuration Files.
Global.asax and Global.vb or Global.cs filesAn optional file for handling application-level events. This file resides in the root directory of an ASP.NET application. The Global.vb class file is a hidden, dependent file of Global.asax. It contains the code for handling application events such as the Application_OnError event. At run time, this file is parsed and compiled. For more information on Global.asax file usage, see Global.asax File.
Styles.cssA cascading style sheet file to be used within the project. For more information see Introduction to Cascading Style Sheets.


The server on which you create your Web Forms pages is typically not the server on which you will deploy the pages and their associated files for production. To deploy a Web project containing Web Forms pages, you may follow one of two approaches:

  • Copy your project to the Web server
  • Create a deployment project

For more information on these options, see Deployment of a Web Setup Project.

See Also

Working with Web Projects | Using Solution Explorer | Web Access Methods | Introduction to Solutions, Projects, and Items | Deployment of a Web Setup Project