Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Ministry of Higher Education & Scientific Research

University of Baghdad
Department of Computer Science

Student’s Name: Ibrahim Hasan Tahir.

Title: ASP.NET MVC.

Course: Second Course.

Stage: Second Stage.

Lecture Name: Programming Technologies.


INTRODUCTION
ASP.NET MVC is a framework for building web applications that applies the
general Model-View-Controller pattern to the ASP.NET framework. Let’s break
that down by first looking at how ASP.NET MVC and the ASP.NET framework
are related.
How ASP.NET MVC Fits in with ASP.NET
When ASP.NET 1.0 was first released in 2002 it was easy to think of ASP.NET
and Web Forms as one and the same thing. ASP.NET has always supported two
layers of abstraction, though:
1. System.Web.UI: the Web Forms Layer, comprising server controls, ViewState,
and so on
2. System.Web: The pluming, which supplies the basic web stack, including
modules, handlers, the HTTP stack, and so on.
The mainstream method of developing with ASP.NET included the whole Web
Forms stack-taking advantage of drag-and-drop server controls and semi-magical
statefulness, while dealing with the complications behind the scenes (an often
confusing page lifecycle, less than optimal HTML that was difficult to customize,
and so on)
However there was always the possibility of getting below all that – responding
directly to HTTP requests, building out web frameworks just the way you wanted
them to work, crafting beautiful HTML – using handlers, modules, and other
handwritten code.
You could do it, but it was painful there just wasn’t a built – in pattern that
supported any of those things.
It wasn’t for lack of patterns in the broader computer science world, though.
By the time ASP.NET MVC was announced in 2007, the MVC pattern was
becoming one of the most popular ways of building web frameworks.
LITRATURE VIEW
Suppose there is one restaurant, in this restaurant some people are working as
follows:
Guys who are an expert cook, they works in kitchen.
Guys (Manager) who take order from customer & write down that order on small
paper with appropriate table number i.e one.
Now some customer comes into the restaurant, the guy who is going to take an
order shows menu card of this restaurant to that customer.
Customer see this menu card. For example, customer see items such as Poha,
Upma, Dosa etc. Now that customer would like to order Poha or dosa, then the
customer can imagine how Poha or Dosa looks like.

After taking order from customer, that guy (Manager) give this small purchi to a
man who is sitting outside the kitchen. This man who is sitting outside the kitchen
is acting like a Controller in MVC, means every order is handled by this controller.
This man gives order to appropriate cook for making the order ready.
The cook will see the order & try to make the food ready. If he needs some extra
items to make food like for Dosa he need to make 1 Chatani from coconuts then
cook, visit the fridge & take this coconut & make chatani ready by adding water,
sugar etc. In this scenario the cook is taking data from the database means cook is
acting like Model in MVC.

After some time, the order of that customer is ready. Now the man sit outside the
kitchen, calls the waiter & tell him to serve this order to the customer who ordered
from table number one.

Now waiter adds some items to make better look & feel of food like he add some.
Now the order is ready to eat. This is actual View in MVC. Waiter is responsible
for making decorate view.
The MVC architectural pattern has existed for a long time in software engineering.
All most all the languages use MVC with slight variation, but conceptually it
remains the same.
Let's understand the MVC architecture supported in ASP.NET.
Model: represents the shape of the data. A class in C# is used to describe a model.
Model objects store data retrieved from the database.
View: View in MVC is a user interface. View display model data to the user and
also enables them to modify them. View in ASP.NET MVC is HTML, CSS, and
some special syntax (Razor syntax) that makes it easy to communicate with the
model and the controller.
Controller: The controller handles the user request. Typically, the user uses the
view and raises an HTTP request, which will be handled by the controller. The
controller processes the request and returns the appropriate view as a response.

As per the above figure, when a user enters a URL in the browser, it goes to the
webserver and routed to a controller. A controller executes related view and
models for that request and create the response and sends it back to the browser.
REFRENCES
https://www.tutorialsteacher.com/mvc/asp.net-mvc-tutorials
https://www.google.iq/books/edition/Professional_ASP_NET_MVC_5/FaQLBAA
AQBAJ?hl=en&gbpv=1
Wikipedia.org

You might also like