Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
ASP.NET MVC Basics: Part 1
WhatsApp
Krishna Garad
13y
59.3k
0
2
100
Article
Introduction:
In this series we will learn the new design pattern provided by Microsoft called the MVC (Model-View-Controller). In this article we will start from what MVC is and then will discuss the following topics.
What is MVC?
How it is differ from Asp.Net?
What is Asp.Net MVC?
What is MVC?
MVC stand for Model-View-Controller architecture. The following diagram can better explain the MVC structure.
You can clearly see from the preceding diagram how these three components are interrelated with each other. We will see each and every component of the architecture one by one.
CONTROLLER
Controller is the first step of MVC which can be explained very well with the following points.
A controller is responsible for controlling the way that a user interacts with an MVC application.
A controller determines what response to send back to a user when a user makes a browser request.
VIEW
The view can be defined as the following:
A view contains the HTML markup and content that is sent to the browser.
A view is the equivalent of a page when working with an ASP.NET MVC application.
We must create views in the right location. The HomeController.Index() action returns a view located at the following path:
\Views\Home\Index.aspx
The HomeController.About() action returns a view located at the following path:
\Views\Home\About.aspx
MODEL
The Model can be defined as.
An MVC model contains all of your application logic that is not contained in a view or a controller
The model will contain all of our application business logic and database access logic and other logic
DataLayer kind of classes, Types for data should be created in MVC model.
Conclusion
In the next articles of this series, we will see most of the differences and advantages of using MVC.
Asp.net
MVC
MVC Basics
Up Next
Ebook Download
View all
Diving Into ASP.NET WebAPI
Read by 21.4k people
Download Now!
Learn
View all
Membership not found