June 19, 2012

Day 1: MVC 4 Highlights


For the last 2 hours what we did was discuss how ASP.NET MVC 4 works. There was no coding yet since our Visual Studio solutions has no MVC 4 template. Our trainor created a sample MVC project and we explored how the structure of MVC differ from that of ASP.NET web forms. And gosh, there was a lot.

MVC 4 does not contain physical files. Unlike in ASP.NET web forms, the codes locate the .aspx files. Let's say I'm at the home page, I want to go to the About page. Therefore, I must have a page called Home.aspx and About.aspx. In MVC 4, these are not needed anymore. The pages are represented by methods in a specific controller. If you notice in a MVC website, there is no .aspx extension in the url. Instead of http://localhost:1111/Home.aspx, you have http://localhost:1111.

We also created a CRUD (create, retrieve, update, delete) functions for the sample project. MVC 4 provides a quick way in generating a form view for the model by using the @Html.EditorForModel() helper. What you need to add is the save button for the transaction.

Tomorrow, we will be creating a project from scratch. Let's see how it will work out. Gladly, we have pork barbecue for lunch! Yippee!

No comments:

Post a Comment