ASP.NET Tutorial - Hello World in 10 minutes

Edit your code

Open Pages/Index.cshtml in any text editor and replace all of the code with the following, then save the file.

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

<div class="text-center">
    <h1>Hello, world!</h1>
    <p>The time on the server is @DateTime.Now</p>
</div>

Once this change is saved, the dotnet watch run command will restart the app and refresh it in the browser so you can see the change in the running app.

Once this change is saved, the dotnet watch run command will restart the app. Refresh the app in the browser to see the change in the running app.

When the page is refreshed, the new content you just added will appear on the page.

Continue