Hi Everyone,
Now, i am working on a very popular topic of ASP.NET i.e. ASP.NET MVC framework. So, i want that can anyone explain how to adding a controller in a my mvc application.
Thank you.
How to add a Controller in ASP.NET MVC
162430-Jan-2016
Updated on 30-Jan-2016
Anupam Mishra
30-Jan-2016MVC stands for model-view-controller. MVC is a pattern for developing applications that are well architected, testable and easy to maintain. MVC-based applications contain:
Let's begin by creating a controller class. In Solution Explorer, right-click the Controllers folder and then click Add, then Controller.
In the Add Scaffold dialog box, click MVC 4 Controller - Empty, and then click Add.
and name your controller "HomeController" and click Add.Now we will write the following code:
We run this project then it produced following results: