Question: 8 . Basic ASP.NET Core Application ( 1 3 Marks ) Scenario: Create a simple web application that displays a welcome message with the user's
Basic ASP.NET Core Application Marks
Scenario: Create a simple web application that displays a welcome message with the user's name.
Page
In line with industry requirements, CTU Training Solutions PTY Ltd is fully accredited by the MICT SETA ACC through the Quality Council for Trades and Occupations
QCTO CTU Training Solutions is registered with the Department of Higher Education and Training as a Private College FE and provisionally registered as a private
higher education institution only selected registered campusesNo HE Directors: R Meeske, E Ferreira, B Brown Co Reg No:
Components:
Controller: Handles user input and interacts with the view.
View: Displays the welcome message to the user.
Steps:
Create a new ASP.NET Core Web Application project: Use Visual Studio or the dotnet new
webapp command. marks
Add a model class: Create a class named Person with properties for Name and optional Message.
marks
Create a controller: Add a controller named HomeController with an Index action method.
marks
Implement the Index action method:
Accept a parameter of type Person named person. mark
If person is null, create a new instance with an empty name. mark
Generate a welcome message using string interpolation: "Welcome, personName
mark
Pass the person object and the welcome message to the view. mark
Create a view: Add a view named Index.cshtml in the ViewsHome folder. mark
Implement the Index.cshtml view:
Access the received person and message data. mark
Display the welcome message using an HTML heading element eg
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
