Skip to main content

Posts

Showing posts with the label MVC

Programming with ASP.NET MVC4 - Part 02

Accessing model data from a controller  In this fragment I am going to explain how to retrieve data from database by controller and display using view template. If you are new to the MVC refer part1. Step 1:  Add controller to your MyMVCMovieList project. Choose and add following details to your controller when adding, Controller Name :- MovieController Template: - Controller with read/write actions and views, using Entity Framework. Model class: - Movie (MvcMovie.Models). Data context class: - MovieDBContext (MvcMovie.Models).

Programming with ASP.NET MVC4 - Part 01

Getting start…. The verbal meaning of MVC is M odel V iew C ontroller. Which is well tested architecture especially designed for web based solutions. Model : classes that represent application data and business rules View: template files application will able to use for dynamically generate html responses. Controller: classes which are manage browser request, retrieve data from model and define the view template for browser response.   Let’s start with simple application. Creating project First of all make sure you are going to use visual studio 11 or above version with c#. Step 1:  Click on FILE ->New ->Project. Step 2: Select Web under Visual c# ->ASP.NET MVC4 Web Application and name project as      “MyMVCMovieList” -> click OK button.

MVC Architecture

Model-View-Controller (MVC) is a design pattern recently most popular among software engineers for applications which are needed to provide multiple views with using same data. I am suggesting MVC is better than WCF, because of this module separation. For an examples       ·          Multiple views and controllers can interface with same model for modification even those never exist before add this model.       ·          It is supporting all type of HTML verbs.       ·          No view state and post back events.       ·          Easy integration with JavaScript framework.       ·          Helps to decrease complexity of project       ·          P...