how to create controller in mvc
To remove the 404 Not Found error, we need to add a controller, which handles all the incoming requests.
Step 1 − To add a controller, right-click on
the controller folder in the solution explorer and select Add → Controller.
Step 2 − Select the MVC 5 Controller – Empty option and click ‘Add’ button.
The Add Controller dialog will appear
Step 3 − Set the name to FirstMVCController and click the Add button.
You will see a new C#
file FirstMVCController.cs in the Controllers folder, which is open for editing
in Visual Studio as well.
No comments: