Web Forms

Overview

ASP.NET Web Forms pages are created in a manner similar to static HTML Web pages (pages that do not include server-based processing), however ASP.NET Web Forms include extra server-side code that ASP.NET, running on a Web server, recognizes and processes when the page is requested by the client. The characteristics that distinguish ASP.NET Web Forms pages from static HTML (or other) pages are as follows:

  • A file name extension of .aspx instead of .htm, .html, or other file name extensions. The .aspx file name extension causes the page to be processed by ASP.NET on the Web server, before the Web server responds to the client's request.

    • The mapping of file name extensions to ASP.NET is done in Internet Information Services (IIS). By default, .aspx pages are run by ASP.NET and .htm and .html pages are not.

  • An optional @ Page directive or other directive, as appropriate to the type of page that you are creating.

  • A form element that is configured correctly for ASP.NET. The form element is required only if the page contains controls whose values you want to use during page processing on the server side.

  • Web server controls.

  • Server-side code either embedded into the ASP.NET Web Form or its linked code-behind class file.

Creating a New Web Forms Project

Visual Studio 2020 Create a New Project dialog box with ASP.NET Web Application (.NET Framework) selceted. This is the choice you need to select for a new Web Forms template to be loaded into Visual Studio.
Visual Studio 2017 New Project dialog box.

Related Links