which Model will be taken, and then it takes the data from the model to the respective view.
Points To Remember
- Controllers are the Classes derived from System.Web.MVC.Controller.
- Controllers contain public methods. These methods are called Action Methods.
- The class name must end with Controller like TestController
- All Controller Classes are available in the Controller Folder Structure.
Steps To Create Controller
Step 1:
Open the Visual Studio and click on File Tab --> New -->Project menu
Select Web from left pan next select asp.net web application and give the proper Name, Location, and Solution at below pan finally click OK button. then you get one more Popup box where you choose the MVC option. Click the OK button. asp.net creates a template for a project.
Step 3:
You can find the Controller folder has some Controller Classes with .cs extensions on the right side. every controller ends with Controller. You can observe from the Controller folder has three classes. These classes are AccountController.cs, HomeController, and ManageCotroller
If you open any one controller then you find the controller inherited from Controller. and each controller has Action Methods. From the below image, you can observe.
Post a Comment (0)