SlideShare a Scribd company logo
MVC
FUNDAMENTAL
Nguyen Thanh Phat – phatnguyen.tit@gmail.com
INDEX
• 1. MVC Pattern Overview
• 2. Language Applied
• 3. Components
• 4. Workflow
• 5. Project Structure
• 6. Major Functions
• 7. Main difference between ASP.Net Web Form
and ASP.Net MVC
• 8. Advantages
• 9. Disadvantages
MVC Overview
Review 3 layers pattern
Presentation
Business access
Data access
Data objects
Data validation, handle data
Data access
Data presentation
Data validation
MVC Overview
• MVC stands for Model – View – Controller
• MVC Pattern is a software architecture and design pattern
used in software engineering.
• MVC Framework is an open source web application
framework that implemented the MVC Pattern.
• Separate source code into 3 components. Each
components has a specific task and connect to other
components.
MVC Overview
.Net Framework
ASP. Net Core Engine
ASP.Net Framework Stack
ASP.Net Web Forms ASP.Net MVC
Language applied
• Ruby – Ruby on Rails, PureMVC.
• .NET - Sprint.Net, MonoRail, ASP.Net MVC.
• Java - Swing, Struts, Spring.
• Python - Django, PureMVC.
• Object-C - Cocoa, Cocoa touch.
Components of MVC
Controller
View
Model
Components of MVC
View
• Handle the display of data and controls.
• Include HTML tabs to show data from Model and
receive input from user
• The View are built from data of the Model.
• Validate input from the client via
JavaScript/Jquery.
• Send user actions to the Controller.
Components of MVC
Controller
• Contain Action (Method)
• Navigate data
• Read user action from the View.
• Execute query to the Model.
• Decide what should be returned to the View.
Components of MVC
Model
• Determine what model the Controller need.
• Business/Domain logic layer
• Receive data from database.
• Calculate, handle data and logic of data.
• Store objects describe data as Classes.
• Include methods of processing and accessing
database.
• Check the validity of data (Model Validation).
Workflow
Controller
Model View
User action
Notify changes
Select View
Change state
Project Structure
Controller classes
Script files
Jquery/AJAX
Model classes
View files
ASPX/CSHTML(Razor View)
Major functions
• Razor View Engine
• Validation
• Routing
Razor View Engine
• Another way of showing data in the View.
• Appear in ASP.Net MVC 3 framework and
later.
• Decrease markup code.
• Provide a compact way to mix code with
markup.
• Use the @ character at first in syntax.
Razor View Engine
ASPX View
Razor View Engine
Razor View
Validation
• Validation with “Validation Attribute” - Server
• Validation with Jquery/Unobtrusive – Client.
Validation Attribute
[Required]
[MaxLength]
[Range]
[Compare]
[DataType]
[RegularExpression]
Extensible
• A value must be provided
• Value must have a specific length
• Value must be in a specific range [a-b]
• Value must be equal another property
• Value must satisfy a type of data
• Value must satisfy a regular expression
• Custom model validation
Validation Attribute
Jquery/Unobtrusive Validation
Web.config
Jquery/Unobtrusive Validation
Add Jquery library
Jquery/Unobtrusive Validation
HTML code generated
Routing
• History
/store/editproduct.aspx?id=50
• Call Controller and Action through parameters base on a
route table
…/product/editproduct/01
…/editproduct/01
Action Parameter valueController
Routing
Global.asax.cs
Routing
Global.asax.cs
Main difference between ASP.Net Web Form and
ASP.Net MVC Framework
ASP.NET Web Forms ASP.NET MVC
Every page(abcd.aspx) has its own
controller (abcd.cs).
Common controller can be used for
many view pages have request.
UI and logic code are coupled tightly. Code is clean because of the
seperation of this pattern.
View page size is big. View page size is small.
One View engine ASPX Support for Multiple View Engines
(Razor, Spark, Ndjango, ..)
Advantage
• - Professionalism in programming
• - Easy to read and understand source code in big project.
• - Easy to develop, improve and maintain program.
Disadvantage
• In small project:
• Waste time in building source code.
• Cause complexity in transfering data between components.

More Related Content

ODP
Mvc
PPTX
MVC architecture by Mohd.Awais on 18th Aug, 2017
ODP
What is MVC?
PPTX
MVC Framework
PDF
Asp.net mvc basic introduction
PDF
MVC architecture
Mvc
MVC architecture by Mohd.Awais on 18th Aug, 2017
What is MVC?
MVC Framework
Asp.net mvc basic introduction
MVC architecture

What's hot (20)

PPTX
Mvc pattern and implementation in java fair
PPTX
Introduction to mvc architecture
PPTX
Design Pattern - MVC, MVP and MVVM
PDF
MVC Architecture
PPT
MVC Pattern. Flex implementation of MVC
PPT
MVC Architecture in ASP.Net By Nyros Developer
PPT
MVC(Model View Controller),Web,Enterprise,Mobile
PPT
Asp.net mvc
ODP
Why Use MVC?
PPT
MVC ppt presentation
PDF
Model View Controller (MVC)
PDF
MVC Seminar Presantation
PPTX
MVx patterns in iOS (MVC, MVP, MVVM)
PPT
Why MVC?
PPTX
ASP.NET MVC Presentation
PPT
MSDN - ASP.NET MVC
PPT
MVC Architecture
PPTX
Model view controller (mvc)
PPT
Introduction to ASP.NET MVC
PPTX
ASP .NET MVC Introduction & Guidelines
Mvc pattern and implementation in java fair
Introduction to mvc architecture
Design Pattern - MVC, MVP and MVVM
MVC Architecture
MVC Pattern. Flex implementation of MVC
MVC Architecture in ASP.Net By Nyros Developer
MVC(Model View Controller),Web,Enterprise,Mobile
Asp.net mvc
Why Use MVC?
MVC ppt presentation
Model View Controller (MVC)
MVC Seminar Presantation
MVx patterns in iOS (MVC, MVP, MVVM)
Why MVC?
ASP.NET MVC Presentation
MSDN - ASP.NET MVC
MVC Architecture
Model view controller (mvc)
Introduction to ASP.NET MVC
ASP .NET MVC Introduction & Guidelines
Ad

Similar to Mvc fundamental (20)

PPTX
ASP.net MVC Introduction Wikilogia (nov 2014)
PPTX
ASPNet MVC series for beginers part 1
PPTX
Asp net mvc series for beginers part 1
PPTX
Getting started with MVC 5 and Visual Studio 2013
PPTX
Intro ASP MVC
PDF
ASP.NET MVC 2.0
PPT
Introduction to ASP.NET MVC 1.0
PPTX
Mvc presentation
PPTX
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
PDF
Aspnetmvc 1
PDF
Asp 1a-aspnetmvc
PPTX
Aspnet mvc
PDF
Introduction to ASP.NET MVC
PPTX
Introduction to ASP.Net MVC
PPTX
ASP.MVC Training
PDF
IRJET- MVC Framework: A Modern Web Application Development Approach and Working
PPTX
Introduction to ASP.NET MVC
PPTX
Asp.net With mvc handson
PPT
ASP.NET MVC Presentation
ASP.net MVC Introduction Wikilogia (nov 2014)
ASPNet MVC series for beginers part 1
Asp net mvc series for beginers part 1
Getting started with MVC 5 and Visual Studio 2013
Intro ASP MVC
ASP.NET MVC 2.0
Introduction to ASP.NET MVC 1.0
Mvc presentation
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
Aspnetmvc 1
Asp 1a-aspnetmvc
Aspnet mvc
Introduction to ASP.NET MVC
Introduction to ASP.Net MVC
ASP.MVC Training
IRJET- MVC Framework: A Modern Web Application Development Approach and Working
Introduction to ASP.NET MVC
Asp.net With mvc handson
ASP.NET MVC Presentation
Ad

Recently uploaded (20)

PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Cloud computing and distributed systems.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Advanced IT Governance
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
NewMind AI Monthly Chronicles - July 2025
Cloud computing and distributed systems.
Advanced methodologies resolving dimensionality complications for autism neur...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Reach Out and Touch Someone: Haptics and Empathic Computing
The Rise and Fall of 3GPP – Time for a Sabbatical?
Per capita expenditure prediction using model stacking based on satellite ima...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Advanced IT Governance
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Unlocking AI with Model Context Protocol (MCP)
Spectral efficient network and resource selection model in 5G networks
Chapter 3 Spatial Domain Image Processing.pdf

Mvc fundamental