How to create MVC First simple application
It is very easy to make application in mvc follow some steps and create first application
STEP 1 - Click on Start menu and Open Visual studio.
STEP 2 - Open View folder click Home folder and click index page run and see on home this is by default in Poject inbuilt page so see esaly. And if we create new Controller then see right click on controller folder and add new controller.
STEP 3 - Open A window and choose Empty controller and click on add button-> open next we give name of the controller.
Ex. we Give name Simplecontroller and click add button. In application add controller like.
In This index is by default create action.
public class SimpleController : Controller
Controller is base class inherit this controller.
STEP 4 - Add on view Right click on Index method ->click on ->Add View. open new window.
Give name view and if we add layout page (master page then choose in drop down if no then leave empty) and click Add button
Ex. in this View index name and create page in View folder-> simple folder->Index page. now we ready to code.
Save yhis content and run this page.
Output-
It is very easy to make application in mvc follow some steps and create first application
STEP 1 - Click on Start menu and Open Visual studio.
STEP 2 - Open View folder click Home folder and click index page run and see on home this is by default in Poject inbuilt page so see esaly. And if we create new Controller then see right click on controller folder and add new controller.
STEP 3 - Open A window and choose Empty controller and click on add button-> open next we give name of the controller.
Ex. we Give name Simplecontroller and click add button. In application add controller like.
In This index is by default create action.
public class SimpleController : Controller
Controller is base class inherit this controller.
STEP 4 - Add on view Right click on Index method ->click on ->Add View. open new window.
Give name view and if we add layout page (master page then choose in drop down if no then leave empty) and click Add button
Ex. in this View index name and create page in View folder-> simple folder->Index page. now we ready to code.
Save yhis content and run this page.
Output-
0 comments :
Post a Comment