Skip to main content

Hands-On ASP .NET Core WebApp

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. 😃

Comments

Popular posts from this blog

Signing Up for Azure 4 Students Account

Sign-Up: Microsoft Azure 4 Students Hola readers, In this post we're gonna learn how to create a new Microsoft Azure Account for Students. As a typical Azure account requires you to provide with the Credit Card details but due to the fact that not all the students around the globe have credit cards. So Microsoft have a provision for granting Azure Credits to students by the help of their Educational Account provided by their School/ Universities. Here are the steps provided to create a new Azure4Students Account (Though a video is also available to follow along): Text version of the SigningUp Process Visit: aka.ms/Azure4Students Sign in with your Microsoft Account or create a Microsoft Account if you don't have one After successfully logging in, enter your Country code & mobile number. Then click on the Verification options (Text/ Call) for your Identity verification. Next comes the Student Verification. This can be done by either: Providing your scho...

Creating a URL Shortener Deplyment on Azure (NodeJS) part-2

For reference to the previous post, please refer to this link : Connecting-to-our-Database Now let's head to the package that we added config in the npm install command, what it does is that it will look for default.json the file inside config (folder) which we created earlier that will consist of the global variables for our project. Now let's open that default.json file and place the below snippet in it: { "mongoURI": "<ConnectionStringHere>" } We'll replace the Connection String from the cluster's string from our Atlas Account (if you still don't have an account, click here to create one) After Logging in to the Atlas, create a free Cluster and add a database user in it Now use the below code in the db.js the file inside the config (folder): const mongoose = require('mongoose'); const config = require('config'); // Grab the Connection string URL from the default.json file const db = confi...

Getting started with Cross-Platform Mobile App Development

My First Xamarin Mobile Application Software Pr-requisite: Visual Studio Community Edition, ( Refer to my previous post for Visual Studio) Download Here: [for Windows] [for Mac] Xamarin Workload in Visual Studio [For Steps Refer this]  Recently After my First Hackathon Experience, I made an application using Microsoft Xamarin and really wanna share it out to everyone via this blog. So Stay tuned... Let's get the Real Work Done! Start Visual Studio (in my case present build: vs2019) Click on Create New Project Search for " Xamarin " in the Search box on top and then select " Mobile App (Xamarin.Forms) " Give your App a Name Select a Blank App Template. In Xamarin.Forms App, the Shared Code resides under, [ YourAppName ]-> MainPage.xaml . Currently I'll be running a UWP (Universal Windows Platform) run to test the App, though in the End there are some Android Screenshots too... Let's make a little change in the MainPage.xaml...
Counter Widget