RG-3
RG-3

Reputation: 6188

Significance of 'Model' in MVC3?

I am NEW in MVC3 so bear with me. I created default ASP.NET MVC3 application. There is a simple registration page in there.

So that calling procedure goes like this:

  1. View (Register.cshtml) calls Controller (AccountController.cs)
  2. Controller calls Model (AccountModels.cs)

I want to know, why there is a need of Model? I mean, what MODEL should supposed to do? Any answers will be appreciated! Thank you.

Upvotes: 1

Views: 477

Answers (4)

J.W.
J.W.

Reputation: 18181

Model should represent your business domain, and it should reflect your application's purpose. View is the UI to expose your business domain, and controller is the bridge between your domain and UI.

Upvotes: 2

Oded
Oded

Reputation: 498904

The model holds that non static data that will be displayed on the page - the View has access to the model and it's properties in order to render them.

Upvotes: 0

Steven Striga
Steven Striga

Reputation: 1381

Models represent data. If your view has no data to load, you don't need a model!

Watch this video- it should explain better than I can in a short comment: Understanding Models, Views, and Controller

Upvotes: 6

Will Dean
Will Dean

Reputation: 39500

Model is everything that the other two aren't. View is pure presentation, Controller is the logic of the view, and model is the stuff you're actually viewing.

Upvotes: 1

Related Questions