Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
What is ASP.NET MVC? To answer this question, we'll start by taking a look at how a website works.
Additional Learning
If you’re unfamiliar with HTTP, be sure to check out the Treehouse HTTP Basics course.
For more information about design patterns, see Craig Dennis’ excellent Introduction to Design Patterns workshop.
Microsoft’s official ASP.NET website is a great resource. Here are the URLs to the three flavors of ASP.NET.
What is ASP.NET MVC?
0:00
To answer this question, let's start by
taking a look at how a website works.
0:02
Every website or web application has two
key participants, client and the server.
0:08
When browsing a website or
using a web application,
0:15
you're using a web browser to
communicate with the server.
0:18
Your browser might be a desktop or
mobile version,
0:22
Chrome, Firefox, Safari or Edge.
0:27
In all of those cases
the browser is the client.
0:30
When you perform an action in
the browser by clicking on a link or
0:34
submitting a form the browser formats and
sends a request to the server.
0:38
The server receives the request and
0:43
prepares a response to
return to the client.
0:45
The format of the request and
response follows a specific set of rules
0:47
known as HTTP, or
Hypertext Transfer Protocol.
0:53
When developing websites,
there are two places that we can run code,
0:59
the client and the server.
1:03
On the client we typically use HTML,
CSS or JavaScript.
1:05
This is often referred to as
client-side or front end development.
1:10
On the server, it's not a straightforward.
1:15
We have a lot of options for
doing server-side or back end development.
1:18
We can use Java, Python, PHP or
1:22
even JavaScript using Node.js,
just to name some.
1:26
But we're looking to use C#.
1:29
So we'll use ASP.NET,
a web framework that's part of .NET.
1:32
ASP.NET comes in several flavors
including web forms, web pages or MVC.
1:37
Of these three options
MVC is the most popular.
1:45
That's lucky for us, since this happens
to be a course about ASP.NET MVC.
1:49
The MVC, and ASP.NET MVC,
refers to the popular MVC design pattern.
1:55
So what is the MVC design pattern?
2:03
You might even be wondering,
what is a design pattern?
2:06
Over the years, developers noticed a set
of problems that kept coming up time and
2:10
time again.
2:15
Some of these problems were so
common, it became obvious
2:17
that it would be helpful to describe and
share solutions in very general terms,
2:20
without regard to any specific
technology or programming language.
2:26
That way developers everywhere could
learn and benefit from their efforts.
2:30
These solutions,
written as descriptions or
2:35
templates, are referred
to as design patterns.
2:38
So what is MVC?
2:42
MVC is a design pattern.
2:45
In fact MVC is a very
common design pattern.
2:47
It's used in a wide variety of server side
frameworks including Ruby on Rails and
2:51
Java Spring Framework.
2:57
It's even used in client-side
JavaScript frameworks like Angular.js.
2:58
Let's take a closer look.
3:03
MVC is an acronym that stands for
Model View Controller.
3:05
The model represents
the data in your website.
3:10
The view is the visual part.
3:13
And the controller is the coordinator.
3:15
When users browse to a specific
page in our website,
3:18
the controller is responsible for
coordinating what specific actions need to
3:20
be performed In order to return
a response for that user request.
3:25
Don't worry if you don't fully understand
how the MVC design pattern works.
3:31
At this point it's good enough to know
that there is something called a mode,
3:36
a view, and a controller.
3:40
As we build a comic book gallery website
we'll continue to explore the MVC
3:43
design pattern.
3:47
All right, we've covered a lot of ground.
3:48
Let's go back to our original question,
what is ASP.NET MVC?
3:51
ASP.NET MVC is a server-side web framework
that utilizes the MVC design pattern.
3:56
It's used to process HTTP requests and
prepare responses
4:04
containing HTML, CSS and
JavaScript for rendering in a browser.
4:09
Although this can seem overly complicated
4:14
especially when you're
new to web development.
4:17
It's okay to feel that way.
4:20
As developers, it's important and
helpful to know the big picture, but
4:22
it's not something that we
think about all the time.
4:27
As we build our website, we'll be focusing
on small individual parts of the process.
4:30
That will make it easier for
us to learn and be productive.
4:36
We covered a lot of
information in this video.
4:40
Let's do a short quiz in order
to reinforce the main points.
4:43
After that, we will create
a GitHub repo for our project.
4:47
See you then.
4:50
You need to sign up for Treehouse in order to download course files.
Sign up