Compartilhar via


Visual Studio Templates for Web Projects

Visual Studio includes project templates to help you get started when you create a web project. You can create web application projects or web site projects. By considering the most appropriate project type before you begin, you can save time when you create, test, and deploy the web project.

Web Project Templates

From the File menu, you can select either New Project or New Web Site. The New Project dialog box provides a list of web application templates. Use the web application project template to create web applications that are compiled into an assembly and that provide rich options for deployment.

The New Web Site dialog box provides a list of web site templates. Use the Web Site project template when you want to compile the source code dynamically. For more information about the differences between web project types, see Web Application Projects versus Web Site Projects.

NoteNote

You can install additional products by using the NuGet package manager. In some cases, these products include additional templates for new projects. The lists in this topic show you only the templates that are included by default with Visual Studio 2012.

Web Application Templates

Web application templates help you create a web project that is compiled into an assembly for deployment. The following table lists templates that appear in the New Project dialog box under the Web category after you select a language (Visual Basic or Visual C#).

Project Template

More Information

ASP.NET Web Forms Application

Use this project template to create a web application that is based on ASP.NET Web Forms pages and that includes the following functionality. You can choose not to use any of these features when they are not required for your application.

  • A master page.

  • A cascading style sheet.

  • Login security that uses the ASP.NET membership system.

  • Ajax scripting that uses jQuery.

  • Navigation that uses a menu control.

By default, the ASP.NET Web Application project template includes the following:

  • Folders to contain membership pages, client script files, and cascading style sheet files.

  • A data folder (App_Data), which is granted permissions that allow ASP.NET to read and write to it at run time.

  • A master page (the Site.master file).

  • Web pages named Default.aspx, Contact.aspx, and About.aspx. These content pages are based on the default master.

  • A global application class (Global.asax file).

  • A Web.config file.

  • A Packages.config file.

  • For more information, see ASP.NET Web Application Projects and Web Application Projects versus Web Site Projects in Visual Studio.

ASP.NET MVC 3 Web Application

Use this project template to create web applications that use a model-view-controller pattern, using the ASP.NET MVC 3 release. The MVC pattern helps separate the different aspects of the application (input logic, business logic, and UI logic), while providing a loose coupling between these elements. In addition, this project template promotes test-driven development (TDD).

For more information, see ASP.NET MVC Overview.

ASP.NET MVC 4 Web Application

Use this project template to create web applications that use a model-view-controller pattern, using the ASP.NET MVC 4 release.

For more information, see ASP.NET MVC Overview.

ASP.NET Empty Web Application

This template creates an ASP.NET web application that includes a Web.config file, but no other files. Use this project template when you do not require the functionality built into the standard template.

ASP.NET Dynamic Data Entities Web Application

Use this project template to create a Dynamic Data web application that uses the ADO.NET Entity Framework. This type of Dynamic Data web application can target any relational database.

Dynamic Data automatically generates a functional web application for viewing and editing data, based on the schema of the data. For more information, see ASP.NET Dynamic Data Overview.

ASP.NET AJAX Server Control

Use this project template to create a web server control for ASP.NET Web Forms pages that incorporates Ajax functionality. The control consists of server and client code that work together to produce rich client behavior.

For more information, see ASP.NET AJAX Overview.

ASP.NET AJAX Server Control Extender

Use this project template to create an Ajax component that enhances the client capabilities of standard ASP.NET web server controls.

For more information, see ASP.NET AJAX Extender Controls Overview.

ASP.NET Server Control

Use this project template to create a custom ASP.NET web server control that can be used in ASP.NET Web Forms pages.

For more information, see Developing Custom ASP.NET Server Controls.

Web Site Templates

Web site templates help you create a web project that by default is compiled dynamically. The following table lists templates that appear in the New Web Site dialog box.

Project Template

More Information

ASP.NET Web Forms Site

Use this project template to create a website that includes the following functionality. You can choose not to use any of these features when they are not required for your application.

  • A master page.

  • A cascading style sheet.

  • Login security that uses the ASP.NET membership system.

  • Ajax scripting that uses jQuery.

  • Navigation using a menu control.

By default, the ASP.NET Web Site project template includes the following:

  • Folders to contain membership pages, client script files, and cascading style sheet files.

  • A data folder (App_Data), which is granted permissions that allow ASP.NET to read and write to it at run time.

  • A master page (.master file).

  • Web pages named Default.aspx and About.aspx. In the project template, these pages are content pages that use default master page.

  • A global application class (Global.asax file).

  • A Web.config file.

For more information, see Walkthrough: Creating a Basic Web Page in Visual Studio.

ASP.NET Web Site (Razor v2)

Use this project template to create a website that uses ASP.NET Web Pages version 2 with Razor syntax. For more information, see Introduction to ASP.NET Web Programming Using the Razor Syntax.

ASP.NET Web Site (Razor)

Use this project template to create a website that uses ASP.NET Web Pages with the Razor syntax. For more information, see Introduction to ASP.NET Web Programming Using the Razor Syntax.

ASP.NET Empty Web Site

This template creates an ASP.NET website that includes a Web.config file but no other files. Use this project template when you do not require the functionality built into the standard.

ASP.NET Dynamic Data Entities Web Site

Use this project template to create a Dynamic Data website that uses the ADO.NET Entity Framework. This type of Dynamic Data web application can target any relational database.

Dynamic Data automatically generates a functional web application for viewing and editing data, based on the schema of the data. For more information, see ASP.NET Dynamic Data.

WCF Service

Use this project template to create a Windows Communication Foundation (WCF) service. You can extend the service so that a website, web application, Silverlight application, Ajax application, or other client can call it.

For more information, see Windows Communication Foundation.

ASP.NET Reports Web Site

Use this project template to create an ASP.NET website that contains a report (.rdlc file), a default ASP.NET Web Forms page (.aspx file) that contains a ReportViewer control, and a Web.config file. For more information, see Microsoft Reports.

See Also

Other Resources

Visual Web Developer Content Map (4.0)