How To Work With MVC

Here are the steps, 

Step 1: Go to Visual Studio and click new project as sin the following figure 1,

New 

Step 2: Then select MVC 4 Web Application as in the following figure 2,

web

Step 3:

Now write the project name and click on OK button then one new window will open. In this new window there will be option of selecting Project template as Empty, Basic, Internet Application, Mobile Application and Web API. Choose any one of these project template, then select View engine as your choice as in the following figure 3,

empty

Now click on OK button and your Solution Explorer will be like following figure 4,

solution

Step 4: Now go to Views folder, click with right mouse button and select Add, then View as in the following figure 5,

View

Step 5: Now new window will appear as figure 6. In this write View Name and click on Add Button .

add

Step 6: Now View page will appear as in the following figure 7. Now write the code which is required for View page.

code

Step 7: Now go to Controller folder and click with right mouse button and select Add then controller as in the following figure 8,

Controller

Step 8: Now new window will open as in the following Figure 9 then write the Controller Name and click on button Add.

add

Step 9: Now Controller page will appear as in following  figure 10. Now write the code which is required for project.

code

Now run the application and check.

Up Next
    Ebook Download
    View all
    Learn
    View all