From the course: Learning ASP.NET

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Build dynamic pages with Razor syntax

Build dynamic pages with Razor syntax

From the course: Learning ASP.NET

Start my 1-month free trial

Build dynamic pages with Razor syntax

- [Instructor] Now that we've covered the basic concepts behind web pages in Razor, let's get back to Visual Studio. We'll start off by creating a new ASP.NET website. Under the file menu, select new project, then under the web node, click on previous versions. Select the option for ASP.NET website with Razor version 3. And I'll name the project RazorWepPagesApplication. I'll add it to our existing solution, and click okay. By picking this template, Visual Studio set up a fully functional website for us. Let's take a look at its contents. There are some default web pages here to get us started. Notice how they all have cshtml for the file extension. CS stands for C Sharp, the server-side language we'll be embedding into HTML. Let's add a new web page by right clicking on the project, and selecting add new item. Then pick Web Page with Razor, then name it Course.cshtml. We now have the shell of a page with basic HTML elements. What I'd like to do is display a list of popular courses…

Contents