Question: Using ASP.NET MVC in virtual studio create an MVC Project called Project as follows: It should have a Home controller with the following two actions:

Using ASP.NET MVC in virtual studio

create an MVC Project called Project as follows: It should have a Home controller with the following two actions:

Index, which has a return type of ActionResult and no parameters. In its body, it should add the current year to the ViewBag property under the name CurrentYear.

o Its associated view should then display the following text:

The current year is: X Where X is the CurrentYear value retrieved from the ViewBag property

. AgeCalculator, which has a return type of ActionResult and an integer parameter called BirthYear. In its body, it should subtract BirthYear from the current year and assign the result to ViewBag property under the name Age.

o Its associated view should then display the following text: You are X years old! Where X is the Age value retrieved from the ViewBag property.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!