Skip to main content

Featured post

Learn Basics of Computer

What is Computer ? Computer is an electronic data processing machine which accepts input data from the user, stores the input data in its memory, processes the input data according to given instructions and finally gives us the desired output. What are Data ? Data are the raw facts and figures in the form of bits and bytes. What is information ? Information is processed data. Components of Computer Computer has two components. Such as: Hardware Software What is Hardware ? All the parts of computer that we can see and touch are known as hardware. Example - Keyboard, Mouse, Monitor, etc. What is Software ? A set of statements written in a programming language is known as a instruction. A set of instructions is known as a program. A set of programs is known as a software. Example - Microsoft Windows, Adobe Photoshop, Typing Master, etc. Classification of Computers Computers can be classified into three categories. Those are: According to type of dat...

Get started with ASP.NET Core MVC

Get started with ASP.NET Core MVC

Table of Contents

This tutorial teaches ASP.NET Core MVC web development with controllers and views. If you're new to ASP.NET Core web development, consider the Razor Pages version of this tutorial, which provides an easier starting point.

This is the first tutorial of a series that teaches ASP.NET Core MVC web development with controllers and views.

At the end of the series, you'll have an app that manages and displays movie data. You learn how to:

  • Create a web app.
  • Add and scaffold a model.
  • Work with a database.
  • Add search and validation.

View or download sample code (how to download).

Prerequisites

Create a web app

  • Start Visual Studio and select Create a new project.
  • In the Create a new project dialog, select ASP.NET Core Web Application > Next.
  • In the Configure your new project dialog, enter MvcMovie for Project name. It's important to name the project MvcMovie. Capitalization needs to match each namespace matches when code is copied.
  • Select Create.
  • In the Create a new ASP.NET Core web application dialog, select:
    • .NET Core and ASP.NET Core 5.0 in the dropdowns.
    • ASP.NET Core Web App (Model-View-Controller).
    • Create.

Create a new ASP.NET Core web application

For alternative approaches to create the project, see Create a new project in Visual Studio.

Visual Studio used the default project template for the created MVC project. The created project:

  • Is a working app.
  • Is a basic starter project.

Run the app

  • Select Ctrl+F5 to run the app without the debugger.

    Visual Studio displays the following dialog:

    This project is configured to use SSL. To avoid SSL warnings in the browser you can choose to trust the self-signed certificate that IIS Express has generated. Would you like to trust the IIS Express SSL certificate?

    Select Yes if you trust the IIS Express SSL certificate.

    The following dialog is displayed:

    Security warning dialog

    Select Yes if you agree to trust the development certificate.

    For information on trusting the Firefox browser, see Firefox SEC_ERROR_INADEQUATE_KEY_USAGE certificate error.

    Visual Studio:

    The address bar shows localhost:port# and not something like example.com. The standard hostname for your local computer is localhost. When Visual Studio creates a web project, a random port is used for the web server.

Launching the app without debugging by selecting Ctrl+F5 allows you to:

  • Make code changes.
  • Save the file.
  • Quickly refresh the browser and see the code changes.

You can launch the app in debug or non-debug mode from the Debug menu item:

Debug menu

You can debug the app by selecting the IIS Express button

IIS Express

The following image shows the app:

Home or Index page

Comments

Popular posts from this blog

CakePHP 3.10 Content Management Tutorial

How to Install Croogo CMS on Ubuntu 18.04 LTS

How to Build a Dedicated Web Server : 4 Steps