ASP.NET Web Pages 2

ASP.NET Web Pages with Razor syntax is a programming framework for creating web applications. It is included as part of Microsoft WebMatrix Extensibility, which is a free development environment. WebMatrix has a page editor, a database (SQL Server Compact), and a Web server for testing (IIS Express). It also includes other tools to help you create and manage sites. If you like, you can create web pages that use ASP.NET Razor syntax in Visual Studio, which provides additional features like a debugger.

ASP.NET Razor syntax uses a simple programming syntax that lets you embed server-based code into a web page. The page can also contain HTML markup, CSS information, and client script (JavaScript and jQuery). Razor syntax is based on ASP.NET, which is the part of the .NET Framework that's specifically designed for creating web applications. Razor syntax gives you all the power of ASP.NET, but it uses a simplified syntax that's easier to learn if you are a beginner. If you're an expert, it makes you more productive. Even though this syntax is easy to use, its relationship to ASP.NET means that as your web applications become more sophisticated, you have the power of the larger framework available to you.

When a page runs that has Razor code in it, the server runs that code before it sends the page to the browser. By running on the server, the code can perform tasks that can be more complex to do using client content alone, such as accessing server-based databases. Most importantly, server code can dynamically create client content. It can generate HTML markup or other content on the fly and then send it to the browser along with any static HTML in the page.

Documentation Resources for ASP.NET Web Pages

Most of the documentation for ASP.NET Web Pages with Razor syntax is published on the ASP.NET website (https://asp.net/web-pages). Additional information is available on other websites and in blogs.

Scenario

Topics

Getting Started

Introducing ASP.NET Web Pages 2 - Getting Started. This tutorial is the first entry in a multipart tutorial that introduces ASP.NET Web Pages 2 for people who know some HTML. The tutorial includes information on how to install everything you need to get started.

Microsoft WebMatrix. Information on the Microsoft.com/web site about how to download and install WebMatrix and ASP.NET Web Pages. This article is useful if you don't want to go through the ASP.NET Web Pages tutorial (previous item).

Introduction to ASP.NET Web Programming Using the Razor Syntax (C#). A high-level overview of the basics of using Razor syntax in ASP.NET Web Pages (.cshtml) files. If you prefer, you can read an equivalent article for Visual Basic: Introduction to ASP.NET Web Programming Using the Razor Syntax (Visual Basic)

Starting Web Development with Microsoft WebMatrix. This comprehensive tutorial is aimed at developers who have some experience already with HTML, C#, and Razor.

ASP.NET Web Pages videos. Listing of videos that introduce ASP.NET Web Pages.

The Top Features in Web Pages 2. A summary of features introduced for version 2 of ASP.NET Web Pages.

Samples of real-world tasks that you can do using Web Pages

ASP.NET Web Pages Samples. Listing of samples that show how to use ASP.NET Web Pages for tasks such as connecting with mobile devices, using RESTful services.

Using WebMatrix and Visual Studio tools

Getting Started with WebMatrix and ASP.NET Web Pages. An introduction to creating ASP.NET Web Pages in WebMatrix.

Program ASP.NET Web Pages in Visual Studio. Information about using Visual Studio to work with ASP.NET Web Pages.

Exploring WebMatrix. Listing of articles that explore the tools in WebMatrix for using templates to create a site, running reports, and analyzing SEO.

API reference

ASP.NET API Quick Reference. This page provides a compact reference to the most commonly used classes and helpers in ASP.NET Web Pages.

ASP.NET Web Pages 2 Reference

Additional resources

ASP.NET Web Pages (Razor) FAQ

ASP.NET Web Pages (Razor) Troubleshooting Guide

ASP.NET Web Pages 2 ReadMe

Mikesdotnetting.com. Blog of Mike Brind, an ASP.NET MVP, who writes frequently about using ASP.NET Web Pages.

ASP.NET WebMatrix and Web Pages forum

Submit a bug or suggestion