Learn ASP.NET Web Pages by building a web site from scratch.
Part II: Creating standard folders and a consistent style.
In this chapter we will:
If you have followed this tutorial, you already have a web site called Demo.
If not you can create an empty web site with WebMatrix:
In the folder named "Demo" (your website), create 5 folders:
In the "Shared" folder, create a new style sheet (CSS file) named "Site.css".
Put the following code inside the CSS file:
The CSS file above defines the styles to be used used for
In the "Shared" folder, create a new file named "Layout.cshtml".
Put the following code inside the layout file:
The layout file above defines the layout of your web pages. It has a link to your style sheet file (Shared/Site.css), and a call to the @RenderBody() function, where page content should be displayed.
In your empty "Demo" folder, create a new file, named "Default.cshtml".
If you created a file with this name earlier, you can edit the existing file, or create a new file with a new name (like Default2.cshtml).
Put the following code inside the file:
The file starts with a reference to the layout file, otherwise it contains normal HTML markup.
You have created your first web site, with a main page (the Default page), a common template for all your pages (the Layout page), and a common style sheet (the CSS file).
In the next chapters of this tutorial, we will add navigation to the web site. Then we will add a database, and finally we will add login and security.
The perfect solution for professionals who need to balance work, family, and career building.
More than 10 000 certificates already issued!
The HTML Certificate documents your knowledge of HTML.
The CSS Certificate documents your knowledge of advanced CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The jQuery Certificate documents your knowledge of jQuery.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $3.98 Unlimited Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| Download XML Editor |
| FREE Website BUILDER |
| Best Website Templates Top CSS Templates |
| CREATE HTML Websites |
| EASY WEBSITE BUILDER |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|