Tuesday, July 5, 2011

ASP.NET Razor - Create a Web Page



Use WebMatrix to create web pages. Use file type CSHTML for Razor pages.

Create a Web Page with WebMatrix

Select the Files workspace. This workspace lets you work with files and folders. The left pane shows the file structure of your site.
WebMatrix
In the ribbon, click New:
WebMatrix
Choose file type CSHTML, (You will learn more about CSHTML files later) and in the Name box, type default.cshtml:
WebMatrix
When you click OK, WebMatrix creates a web page and opens it in the editor:
WebMatrix
Add title, heading, and paragraphs:
<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Hello World Page</title>
</head>
<body>
    <h1>Hello World Page</h1>
    <p>Hello World Page</p>
</body>
</html>
In the Quick Access Toolbar, click Save:
WebMatrix
In the ribbon, click Run:
WebMatrix
WebMatrix starts a web server (IIS Express) that you can use to test pages on your computer. The page is displayed in your default browser.
WebMatrix

No comments:

Post a Comment