Table of contents
1.
Introduction
1.1.
Download and Install ASP.NET App
1.2.
Run The Downloaded File
1.3.
Check the installed files
2.
Create Your ASP.NET App
2.1.
What files were created?
2.2.
What does this command mean?
3.
Run Your ASP.NET App
4.
Code Example
4.1.
Index.cshtml
5.
FAQs
6.
Key Takeaways
Last Updated: Aug 13, 2025

ASP.NET First App

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Source: Link

Introduction

Active Server Pages (ASP) and Active Server Pages (ASP.NET) are server-side technologies for displaying interactive web pages. ASP.NET offers developers a wide range of options in a large, diverse ecosystem of libraries and tools. Developers can also design custom libraries that can be shared with any.NET platform application.

Backend code for ASP.NET apps can be written in C#Visual Basic, or even F#. Developers can effectively code the business logic and data access layer because of this flexibility. Another big benefit of utilising ASP.NET is the ability to create dynamic web pages in C# using the Razor webpage template grammar tool.

In addition to HTML, CSSJavaScript, and C#, Razor has a syntax for constructing interactive dynamic web pages. Client-side code is commonly written in JavaScript, and ASP.NET can even operate with other web frameworks like Angular or React.

ASP.NET also contains an authentication system for developers, which includes a database, libraries, templates for handling logins, external authentication to Google, Facebook, and other services, and more. ASP.NET may be used on all major platforms, including Windows, Linux, macOS, and even Docker, by developers.

Let us learn how to create our first ASP.NET App.
 

Download and Install ASP.NET App

Download and install the.NET SDK to begin developing.NET apps (Software Development Kit).

Download Link

Run The Downloaded File

Check the installed files

Once you've installed it, open a new command prompt and run the following command:

dotnet

 

If the installation was successful, we would be able to see something like this:

If everything appears to be in order, click the ‘Continue’ button to go to the next step.

Note: If we get an error saying that "dotnet isn't recognised as an internal or external command”, make sure you've started the afresh command prompt.

Create Your ASP.NET App

To make your app, type the following command into your command prompt.

dotnet new webapp -o MyWebApp --no-https

 

Output:

What files were created?

Several files were produced in the MyWebApp directory to provide you with a ready-to-run web application.

  • The app startup code and middleware setup are found in Program.cs.
  • Some sample web pages for the application can be found in the Pages directory
  • Some project options, such as the .NET SDK version to target, are defined in MyWebApp.csproj.
  • Various profile settings for the local development environment are defined in the launchSettings.json file in the Properties directory. When a project is created, a port number between 5000 and 5300 is automatically allocated and saved to this file.

What does this command mean?

A new application is created with the dotnet new command.

  • When developing your app, the webApp option determines the template to use.
  • The -o option creates a directory called MyWebApp, in which your app will be saved.
  • The -no-https flag tells the server not to use HTTPS.

Note: If you see a message like the below,

"ASP.NET Core Web App" could not be created. Failed to create the template. Details: Access to the path 'C:\Windows\System32\MyWebApp' is denied.

Then switch to a directory where you have permission to make a new folder and try running the command again.

If Windows is unable to locate the SDK when you attempt to build the project despite the fact that you are certain the SDK has been installed, your machine may have a problem with the PATH environment variable. Instructions on how to identify and fix this problem may be found in this Stack Overflow topic.

Run Your ASP.NET App

Navigate to the new directory generated in the previous step on your command prompt:

cd MyWebApp

 

Then, run the following command:

dotnet watch

 

We should get something like this as a result:

When we run the dotnet watch command, it will build and start the app, then update it whenever we make changes to the code. Ctrl+C can be used to exit the app at any moment.

Wait for the programme to say it's listening on http://localhost:port <number> for the browser to open at that address.

Congratulations on completing and running your first.NET web application!

Code Example

In any text editor, open the Index.cshtml file in the Pages directory.

Make sure you're on the cshtml page, not the cshtml.cs page, when you open it. Windows may hide the file extension depending on how your system is set up.

We should save the file after replacing all of the code with the following. The modifications you'll be making are shown by the highlighted lines of code.

Index.cshtml

@page
@model IndexModel
@{
   ViewData["Title"] = "Home page";
}

<div class="text-center">
   <h1>Welcome to Coding Ninjas</h1>
</div>

 

When you save this change, the dotnet watch command will apply it to the running app and refresh it in the browser, allowing you to observe the change.


 

FAQs

  1. What is ASP.NET?
    Active Server Pages (ASP) and Active Server Pages (ASP.NET) are server-side technologies for displaying interactive web pages. ASP.NET offers developers a wide range of options in a large, diverse ecosystem of libraries and tools.
     
  2. What is the command used to verify the presence of ASP.NET in the system?
    We use the "dotnet" command to check the presence of ASP.NET in the system and to check its version.
     
  3. What are the core sections of the ASP.NET App page?
    A server-side file with the.aspx extension is also known as an ASP.NET page. It's modular in design and may be broken down into the following sections:
    Directives for the Pages
    Page Layout for the Code Section
     
  4. What are page directives in ASP.NET App?
    The page directives create the conditions in which the page will operate. The @Page directive is used by the ASP.NET page parser and compiler to declare page-specific characteristics. Page directives define how a page should be processed and what assumptions should be made about it.
     
  5. What is the response object in ASP.NET App?
    In ASP.Net App, the Response object is used to communicate data back to the user. The ASP.net specific code is added using the <% and %> markers.

Key Takeaways

In this article, We learned about how to download and install ASP.NET framework.We also learned about how to create an ASP.NET App. We also saw how to run ASP.NET app and how to modify our first ASP.NET App.

Apart from this, you can also expand your knowledge by referring to these articles on Features Of ASP Net and ASP Full Form.

For more information about backend development, get into the entire Backend web development course.

Happy Learning!

Live masterclass