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
Get step-by-step solutions from verified subject matter experts
