.NET Core Tutorials – Razor Pages – Creating a web project


With this tutorial you can create a razor pages web app.

Prerequisites: Visual Studio 2019 Community with dotnet core 2.1 or later

You can download the project code here

  1. Open Visual Studio 2019 and in “File” menu, select “New > Project”
  2. Select “Create a new ASP.NET Core Web Application” and select “Next”  01.png
  3. In project configuration set project name “MoviesManager”
  4. click on “create” button02
  5. Select “ASP.NET Core 2.1” in the dropdown, then “Web Application”
  6. click on “create” button 03

To run this first base application:

Press Ctrol+F5

04

First time, you will see this alert:

trustcert

Press “Yes” to confirm the IIS SSL certificate to trust the application

Then you recieve an alert like this:

cert

Press “Yes” to install the certificate

IIS runs the app and open it in your default browser (you can receive a security alert in your browser)

Project Files

The project is composed by this files and folders:

“Pages” folder:

Contains the razor pages. Each razor page contain 2 files, .cshtml file with HTML and razor/c# syntax and .cshtml.cs file with code that handles page events

05

Some files have names that begin with an underscore.
For example,  _Layout.cshtml file configures UI elements common to all pages (header and footer areas for example). This files with underscore are common files within the project under “Shared” folder

06

“wwwroot” folder:

Contains static files, such as HTML files, JavaScript files, and CSS files.

07

“appSettings.json” file:

Contains configuration data (connection strings, etc)

“Program.cs” file:

Application entry point.

“Startup.cs” file:

Contains code that configures app behavior (any type of behavior to need be initialized, such us, logs, security, etc)

“Dockerfile” file:

Contains Docker instructions to deploy.

You can download the project code here

 

GOTO next step: “.NET Core Tutorials – Razor Pages – Adding a model”

GOTO topic index

 

About the author:

Matías Creimerman

Matías Creimerman
I’m a specialist in design, development and management of software solutions with almost 20 years of experience. Microsoft Certificated Professional (MCP). Expert in dot net and Microsoft technologies. Experience and skills in designing solutions in a wide range of commercial, industrial and production areas. Design of architectures, software applications and processes. Skills in leadership and team management. Tech trainer. Technology researcher. Self-taught and dedicated to continuous learning. Skills in estimation, quotation, projects proposals and solutions design. Entrepreneurial spirit. Strong Tech profile but also customer oriented. I perform roles as fullstack dev, tech consultant, technical referent, development leader, team leader, architect, cross leader, tech manager, tech director, trainer, ramp-up & follow-up teams, software factory manager, DevOps and release manager. Regular chess player and musician.

Professional Website

In

Blogger

Github

About Me

Portfolio

Wordpress - Arquitectura y desarrollo de software

Wordpress - Personal Blog

Microsoft - Youracclaim Badges

Microsoft - Tech Profile

Microsoft - ASP.NET Forum

tw
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License
Creative Commons License
This content is property of Matias Creimerman Any misuse of this material will be punishable
This work is licensed under a International Copyright Law protects “original works of authorship”
including photographs, videos, and blog posts posted on social media sites
The content has no rights to be shared without authorization or citation to the author.
This content cannot be sold be adapted or modified partially or totally.
All content shared outside this blog that doesn’t belong to the author must have citations to the author.

Publicado por:

Matias Creimerman

I’m a specialist in design, development and management of software solutions with 20 years of experience. Microsoft Certificated Professional (MCP). Expert in dot net and Microsoft technologies. Experience and skills in designing solutions in a wide range of commercial, industrial and production areas. Design of architectures, software applications and processes. Skills in leadership and team management. Tech trainer. Technology researcher. Self-taught and dedicated to continuous learning. Skills in estimation, quotation, projects proposals and solutions design. Entrepreneurial spirit. Strong Tech profile but also customer oriented. I perform roles as fullstack dev, tech consultant, technical referent, development leader, team leader, architect, cross leader, tech manager, tech director, trainer, ramp-up & follow-up teams, software factory manager, DevOps and release manager. Regular chess player and musician.

Categorías Código,Teoría,Trainings,TutorialsEtiquetas , , , , , , , , Deja un comentario

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google photo

Estás comentando usando tu cuenta de Google. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s