- ASP.NET WP - Publish
- ASP.NET WP - Security
- ASP.NET WP - Caching
- Add Social Networking to the Website
- ASP.NET WP - Add Search
- ASP.NET WP - Add Email
- ASP.NET WP - Working with Videos
- ASP.NET WP - Working with Images
- ASP.NET WP - Working with Files
- ASP.NET WP - Charts
- ASP.NET WP - WebGrid
- ASP.NET WP - Delete Database Data
- ASP.NET WP - Edit Database Data
- ASP.NET WP - Add Data to Database
- ASP.NET WP - Database
- ASP.NET WP - Page Object Model
- ASP.NET WP - Working with Forms
- ASP.NET WP - Layouts
- ASP.NET WP - Programming Concepts
- ASP.NET WP - Global Pages
- Project Folder Structure
- ASP.NET WP - View Engines
- ASP.NET WP - Getting Started
- ASP.NET WP - Environment Setup
- ASP.NET WP - Overview
- ASP.NET WP - Home
ASP.NET WP Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
ASP.NET WP - Getting Started
In this chapter, we will look at how to start a simple example using ASP.NET Web Pages. To begin with, we will create a new website and a simple web page.
How to Create a Blank Website?
To start with, launch Microsoft WebMatrix which we have installed in the previous chapter.
We will create a blank site and then and add a page. To start with, cpck New and it will display the built-in templates.
Templates are pre-built files and pages for different types of websites. To see all of the templates that are available by default, select the Template Gallery option.
Select the Empty Site template and enter the Site Name. In this case, we have entered FirstWebPageDemo as the Site Name and then we have to cpck Next.
It will install the required packages. Once the installation is finished, WebMatrix creates and opens the site as shown in the following screenshot.
Create an ASP.NET Web Page
Now to understand and become famipar with WebMatrix and ASP.NET Web Pages, let’s create a simple web page by cpcking New in the Home tab.
WebMatrix displays a pst of file types as shown in the following screenshot.
Select CSHTML, and in the Name box, enter FirstPage.cshtml and cpck Ok.
Now you can see that WebMatrix has created the page and opens it in the editor.
Let us first update the FirstPage.cshtml page as shown in the following program.
@{ } <!DOCTYPE html> <html lang = "en"> <head> <meta charset = "utf-8" /> <title>Welcome to ASP.NET Web Pages Tutorials</title> </head> <body> <h1>Hello World, ASP.NET Web Page</h1> <p>Hello World!</p> </body> </html>
Now to test this web page, let’s select the arrow which is below the Run option on the Home tab and select Internet Explorer as shown in the following screenshot.
Now you will see the following empty web page.
Now let’s specify the following url − http://localhost:46023/firstpage in the browser and you will see the following output.
Advertisements