Loading, please wait...

A to Z Full Forms and Acronyms

Hands-On ASP .NET Core WebApp

Apr 29, 2020 Microsoft, ASPDotNetCore, WebApps, 10445 Views
This article gives you a Hand- on Introduction to the WebApp creation using ASP .NET Core

Here come the most awaited article on how to get started with the Hands- On with the ASP .NET Core via Visual Studio Code (VS Code: Text Editor) and a command line prompt.

So if you’re new to the ASP .Net Core, then do have a look at this article. Though the Command line terminal is integrated inside VS Code, still we’ll use MS Command prompt. In the later articles we’ll use the integrated VSCode Interface to interact with the Terminal

So to get started with ASP .NET Core:

  1. Open the Command prompt on windows or Terminal on Linux or bash on Mac accordingly.
  2. Navigate to the directory where we want to create our first Web App.
  3. Run the following command (without “” quotes):
    1. “dotnet new webApp -o myWebApp --no-https”
    2. “cd myWebApp”

  1. Now that we’ve run the above commands we can see that a folder is created in the name of “myWebApp” and it has a basic sample Web Application of the Application.
  2. Now let’s run the application by using the Command Line, and see what’s inside of the Application.
  3. Run the following command in the command line (make sure to run the below command after navigating inside the project directory in the console):
    1. “dotnet run”

  1. Now open the browser and type “localhost:5000” in the browser (or the url mentioned in the output of the above command)
  2. You’ll notice that the website by default supports the responsiveness for the navigation bar. It is due to the Bootstrap framework it is using.
  3. To stop the website from running state, simply press “ctrl+c”.
  4. Now do some tweaks in the website, like add a Welcome message. Switch to the VS Code and open the project folder in it.
  5. Now open the file named “Index.cshtml” present in the Folder “Pages”
  6. Now let’s change some HTML inside the <H1> tag and the <p> tag:
    1. Content inside the <H1> tag: Welcome to my First Demo on ASP .NET Core Web Apps
    2. Content inside the <p> tag: Hi, this is a sample website generated from the “dotnet new webApp -o myWebApp --no-https” command

  1. Now let’s run the application by “dotnet run” again.

Thank you so for your time and efforts. Stay tuned, exciting stuff on the way. 😃

A to Z Full Forms and Acronyms