SlideShare a Scribd company logo
MARIO B. CADAY
Instructor I
Introduction to MVC
Introduction to MVC
 Software design pattern for developing web applications
 Software architecture pattern which separates the representation of information from the
users interaction with it
 Here M stands for Model, V stands for View and C stands for controller
 ASP.NET MVC helps to develop powerful and pattern-based dynamic websites that enables
a clean separation of concerns and also gives full control on a mark-up
 Also it includes many features that help to develop a sophisticated and modern web
application
https://www.ifourtechnolab.com/
MVC vs WEB FORMS
MVC Web Forms
Easier to Manage Complexity Preservers State over HTTP
Does not use view state or server based forms Page Controller Pattern
Rich Routing Structure View state or server based forms
Support for Test-Driven Development Works well for small teams
Supports Large Teams Well Development is less complex
Architecture of MVC
 A Model View Controller pattern is made up of the following three parts:
 Model
 View
 Controller
•A markup language is a set of markup tags
Architecture of MVC (Cont.)
 Model:
 Responsible for managing the data of the application
 It responds to the request from the view and it also responds to instructions from the controller
to update itself
 Lowest level pattern which is responsible for maintaining data
 Represents the application core (for instance a list of database records)
 Also called the domain layer
•A markup language is a set of markup tags
Architecture of MVC (Cont.)
 View:
 The View displays the data (the database records)
 A view requests information from the model, that it needs to generate an output representation
 Presents data in a particular format like JSP, ASP, PHP
 MVC is often seen in web applications, where the view is the HTML page
•A markup language is a set of markup tags
Architecture of MVC (Cont.)
 Controller:
 It is the part of the application that handles user interaction
 Typically controllers read data from a view, control user input, and send input data to the model
 It handles the input, typically user actions and may invoke changes on the model and view
•A markup language is a set of markup tags
Routing
 A route is a URL pattern that is mapped to a handler
 The handler can be a physical file, such as an .aspx file in a Web Forms application. A
handler can also be a class that processes the request, such as a controller in an MVC
application
 At runtime, Routing engine use the Route table for matching the incoming request's URL
pattern against the URL patterns defined in the Route table
 Register one or more URL patterns to the Route table at Application_Start event
 When the routing engine finds a match in the route table for the incoming request's URL,
it forwards the request to the appropriate controller and action
 If there is no match in the route table for the incoming request's URL, it returns a 404
HTTP status code
•A markup language is a set of markup tags
How it works?
•A markup language is a set of markup tags
How to define route?
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapRoute(
"Default", //Route name
"{controller}/{action}/{id}", //URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } //Default parameters
);
}
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
//To:DO
}
•A markup language is a set of markup tags
Bundling
It is a simple logical group of files that could be referenced by unique name and being
loaded with one HTTP requestor
Bundling and minification reduces the number of HTTP Requests and payload size resulting
in faster and better performing ASP.NET MVC Websites
•A markup language is a set of markup tags
How to define bundling?
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
“~/Scripts/my_custom_js.js”,
….....List of Js..............));
}
protected void Application_Start()
{
BundleConfig.RegisterBundles(BundleTable.Bundles)
}
•A markup language is a set of markup tags
Filter
 ASP.NET MVC Filter is a custom class where you can write custom logic to execute before or after
an action method executes
 Filters can be applied to an action method or controller in a declarative or programmatic way
 MVC provides different types of filters
•A markup language is a set of markup tags
Filter Type Description Built-in Filter Interface
Authorization
filters
Performs authentication and authorizes before executing action
method
[Authorize]
[RequireHttps]
IAuthorizationFilter
Action filters Performs some operation before and after an action method
executes
IActionFilter
Result filters Performs some operation before or after the execution of view result [OutputCache] IResultFilter
Exception filters Performs some operation if there is an unhandled exception thrown
during the execution of the ASP.NET MVC pipeline
[HandleError] IExceptionFilter
Filter
 Filters can be applied at three levels :
 Global Level: Global filters will be applied to all the controller and action methods of an application
// MvcApplication class contains in Global.asax.cs file
public class MvcApplication : System.Web.HttpApplication
{ protected void Application_Start()
{ FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); }
}
// FilterConfig.cs located in App_Start folder
public class FilterConfig
{ public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{ filters.Add(new HandleErrorAttribute()); }
}
•A markup language is a set of markup tags
Filter
• Controller Level: Filters can also be applied to the controller class. So, filters will be
applicable to all the action method of Controller class if it is applied to a controller class
[HandleError]
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
}
•A markup language is a set of markup tags
Filter
 Action method level: Apply filters to an individual action method. So, filter will be
applicable to that particular action method only.
public class HomeController : Controller
{ [HandleError]
public ActionResult Index()
{ return View(); }
}
 Filters run in the following order.
 Authorization filters, Action filters, Response filters, Exception filters
•A markup language is a set of markup tags
MVC EXPLAIN
THANK YOU!
Ad

More Related Content

Similar to Model View Controller-Introduction-Overview.pptx (20)

Php.Mvc Presentation
Php.Mvc PresentationPhp.Mvc Presentation
Php.Mvc Presentation
Niranjan Vaishnav
 
Mvc Brief Overview
Mvc Brief OverviewMvc Brief Overview
Mvc Brief Overview
rainynovember12
 
Session 1
Session 1Session 1
Session 1
Asif Atick
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
John Lewis
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive   jinal desaiMvc interview questions – deep dive   jinal desai
Mvc interview questions – deep dive jinal desai
jinaldesailive
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
Thomas Robbins
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
Tomi Juhola
 
Simple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnanSimple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnan
Gigin Krishnan
 
IRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHPIRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHP
IRJET Journal
 
ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!
Fioriela Bego
 
ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!
Commit Software Sh.p.k.
 
MVC
MVCMVC
MVC
akshin
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
Barry Gervin
 
Mvc
MvcMvc
Mvc
Furqan Ashraf
 
Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9
AHM Pervej Kabir
 
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
dioduong345
 
Asp.net,mvc
Asp.net,mvcAsp.net,mvc
Asp.net,mvc
Prashant Kumar
 
cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)
Varsha Krishna
 
Web api
Web apiWeb api
Web api
udaiappa
 
ASP.NET MVC_Routing_Authentication_Aurhorization.pdf
ASP.NET MVC_Routing_Authentication_Aurhorization.pdfASP.NET MVC_Routing_Authentication_Aurhorization.pdf
ASP.NET MVC_Routing_Authentication_Aurhorization.pdf
setit72024
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
John Lewis
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive   jinal desaiMvc interview questions – deep dive   jinal desai
Mvc interview questions – deep dive jinal desai
jinaldesailive
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
Thomas Robbins
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
Tomi Juhola
 
Simple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnanSimple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnan
Gigin Krishnan
 
IRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHPIRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHP
IRJET Journal
 
ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!
Fioriela Bego
 
ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!
Commit Software Sh.p.k.
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
Barry Gervin
 
Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9
AHM Pervej Kabir
 
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
dioduong345
 
ASP.NET MVC_Routing_Authentication_Aurhorization.pdf
ASP.NET MVC_Routing_Authentication_Aurhorization.pdfASP.NET MVC_Routing_Authentication_Aurhorization.pdf
ASP.NET MVC_Routing_Authentication_Aurhorization.pdf
setit72024
 

More from MarioCaday2 (11)

Server – side Technologies PHP for web dev.pptx
Server – side Technologies PHP for web dev.pptxServer – side Technologies PHP for web dev.pptx
Server – side Technologies PHP for web dev.pptx
MarioCaday2
 
Intro to javascript for web development.pptx
Intro to javascript for web development.pptxIntro to javascript for web development.pptx
Intro to javascript for web development.pptx
MarioCaday2
 
004_Private and public attributes and methods.pptx
004_Private and public attributes and methods.pptx004_Private and public attributes and methods.pptx
004_Private and public attributes and methods.pptx
MarioCaday2
 
Insert Carousel slider in HYPERTEXT MARKUP LANGUAGE.pptx
Insert Carousel slider in HYPERTEXT MARKUP LANGUAGE.pptxInsert Carousel slider in HYPERTEXT MARKUP LANGUAGE.pptx
Insert Carousel slider in HYPERTEXT MARKUP LANGUAGE.pptx
MarioCaday2
 
Parent and Child Classes in Object Oriented Programming.pptx
Parent and Child Classes in Object Oriented Programming.pptxParent and Child Classes in Object Oriented Programming.pptx
Parent and Child Classes in Object Oriented Programming.pptx
MarioCaday2
 
TESDA-TMC1 - Trainers Methodology Part 5
TESDA-TMC1 - Trainers Methodology Part 5TESDA-TMC1 - Trainers Methodology Part 5
TESDA-TMC1 - Trainers Methodology Part 5
MarioCaday2
 
Introduction to System Analysis and Design
Introduction to System Analysis and DesignIntroduction to System Analysis and Design
Introduction to System Analysis and Design
MarioCaday2
 
004_integralpartsofcomputersystem-180706085055.pptx
004_integralpartsofcomputersystem-180706085055.pptx004_integralpartsofcomputersystem-180706085055.pptx
004_integralpartsofcomputersystem-180706085055.pptx
MarioCaday2
 
x-introduction-to-project-management-110720031057-phpapp01-converted.pptx
x-introduction-to-project-management-110720031057-phpapp01-converted.pptxx-introduction-to-project-management-110720031057-phpapp01-converted.pptx
x-introduction-to-project-management-110720031057-phpapp01-converted.pptx
MarioCaday2
 
001_Lecture_Introduction to modern Internet
001_Lecture_Introduction to modern Internet001_Lecture_Introduction to modern Internet
001_Lecture_Introduction to modern Internet
MarioCaday2
 
002_Fundamentals of Computer.pdf
002_Fundamentals of Computer.pdf002_Fundamentals of Computer.pdf
002_Fundamentals of Computer.pdf
MarioCaday2
 
Server – side Technologies PHP for web dev.pptx
Server – side Technologies PHP for web dev.pptxServer – side Technologies PHP for web dev.pptx
Server – side Technologies PHP for web dev.pptx
MarioCaday2
 
Intro to javascript for web development.pptx
Intro to javascript for web development.pptxIntro to javascript for web development.pptx
Intro to javascript for web development.pptx
MarioCaday2
 
004_Private and public attributes and methods.pptx
004_Private and public attributes and methods.pptx004_Private and public attributes and methods.pptx
004_Private and public attributes and methods.pptx
MarioCaday2
 
Insert Carousel slider in HYPERTEXT MARKUP LANGUAGE.pptx
Insert Carousel slider in HYPERTEXT MARKUP LANGUAGE.pptxInsert Carousel slider in HYPERTEXT MARKUP LANGUAGE.pptx
Insert Carousel slider in HYPERTEXT MARKUP LANGUAGE.pptx
MarioCaday2
 
Parent and Child Classes in Object Oriented Programming.pptx
Parent and Child Classes in Object Oriented Programming.pptxParent and Child Classes in Object Oriented Programming.pptx
Parent and Child Classes in Object Oriented Programming.pptx
MarioCaday2
 
TESDA-TMC1 - Trainers Methodology Part 5
TESDA-TMC1 - Trainers Methodology Part 5TESDA-TMC1 - Trainers Methodology Part 5
TESDA-TMC1 - Trainers Methodology Part 5
MarioCaday2
 
Introduction to System Analysis and Design
Introduction to System Analysis and DesignIntroduction to System Analysis and Design
Introduction to System Analysis and Design
MarioCaday2
 
004_integralpartsofcomputersystem-180706085055.pptx
004_integralpartsofcomputersystem-180706085055.pptx004_integralpartsofcomputersystem-180706085055.pptx
004_integralpartsofcomputersystem-180706085055.pptx
MarioCaday2
 
x-introduction-to-project-management-110720031057-phpapp01-converted.pptx
x-introduction-to-project-management-110720031057-phpapp01-converted.pptxx-introduction-to-project-management-110720031057-phpapp01-converted.pptx
x-introduction-to-project-management-110720031057-phpapp01-converted.pptx
MarioCaday2
 
001_Lecture_Introduction to modern Internet
001_Lecture_Introduction to modern Internet001_Lecture_Introduction to modern Internet
001_Lecture_Introduction to modern Internet
MarioCaday2
 
002_Fundamentals of Computer.pdf
002_Fundamentals of Computer.pdf002_Fundamentals of Computer.pdf
002_Fundamentals of Computer.pdf
MarioCaday2
 
Ad

Recently uploaded (20)

How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Ad

Model View Controller-Introduction-Overview.pptx

  • 1. MARIO B. CADAY Instructor I Introduction to MVC
  • 2. Introduction to MVC  Software design pattern for developing web applications  Software architecture pattern which separates the representation of information from the users interaction with it  Here M stands for Model, V stands for View and C stands for controller  ASP.NET MVC helps to develop powerful and pattern-based dynamic websites that enables a clean separation of concerns and also gives full control on a mark-up  Also it includes many features that help to develop a sophisticated and modern web application https://www.ifourtechnolab.com/
  • 3. MVC vs WEB FORMS MVC Web Forms Easier to Manage Complexity Preservers State over HTTP Does not use view state or server based forms Page Controller Pattern Rich Routing Structure View state or server based forms Support for Test-Driven Development Works well for small teams Supports Large Teams Well Development is less complex
  • 4. Architecture of MVC  A Model View Controller pattern is made up of the following three parts:  Model  View  Controller •A markup language is a set of markup tags
  • 5. Architecture of MVC (Cont.)  Model:  Responsible for managing the data of the application  It responds to the request from the view and it also responds to instructions from the controller to update itself  Lowest level pattern which is responsible for maintaining data  Represents the application core (for instance a list of database records)  Also called the domain layer •A markup language is a set of markup tags
  • 6. Architecture of MVC (Cont.)  View:  The View displays the data (the database records)  A view requests information from the model, that it needs to generate an output representation  Presents data in a particular format like JSP, ASP, PHP  MVC is often seen in web applications, where the view is the HTML page •A markup language is a set of markup tags
  • 7. Architecture of MVC (Cont.)  Controller:  It is the part of the application that handles user interaction  Typically controllers read data from a view, control user input, and send input data to the model  It handles the input, typically user actions and may invoke changes on the model and view •A markup language is a set of markup tags
  • 8. Routing  A route is a URL pattern that is mapped to a handler  The handler can be a physical file, such as an .aspx file in a Web Forms application. A handler can also be a class that processes the request, such as a controller in an MVC application  At runtime, Routing engine use the Route table for matching the incoming request's URL pattern against the URL patterns defined in the Route table  Register one or more URL patterns to the Route table at Application_Start event  When the routing engine finds a match in the route table for the incoming request's URL, it forwards the request to the appropriate controller and action  If there is no match in the route table for the incoming request's URL, it returns a 404 HTTP status code •A markup language is a set of markup tags
  • 9. How it works? •A markup language is a set of markup tags
  • 10. How to define route? public static void RegisterRoutes(RouteCollection routes) { routes.MapRoute( "Default", //Route name "{controller}/{action}/{id}", //URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } //Default parameters ); } protected void Application_Start() { RegisterRoutes(RouteTable.Routes); //To:DO } •A markup language is a set of markup tags
  • 11. Bundling It is a simple logical group of files that could be referenced by unique name and being loaded with one HTTP requestor Bundling and minification reduces the number of HTTP Requests and payload size resulting in faster and better performing ASP.NET MVC Websites •A markup language is a set of markup tags
  • 12. How to define bundling? public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery.unobtrusive*", “~/Scripts/my_custom_js.js”, ….....List of Js..............)); } protected void Application_Start() { BundleConfig.RegisterBundles(BundleTable.Bundles) } •A markup language is a set of markup tags
  • 13. Filter  ASP.NET MVC Filter is a custom class where you can write custom logic to execute before or after an action method executes  Filters can be applied to an action method or controller in a declarative or programmatic way  MVC provides different types of filters •A markup language is a set of markup tags Filter Type Description Built-in Filter Interface Authorization filters Performs authentication and authorizes before executing action method [Authorize] [RequireHttps] IAuthorizationFilter Action filters Performs some operation before and after an action method executes IActionFilter Result filters Performs some operation before or after the execution of view result [OutputCache] IResultFilter Exception filters Performs some operation if there is an unhandled exception thrown during the execution of the ASP.NET MVC pipeline [HandleError] IExceptionFilter
  • 14. Filter  Filters can be applied at three levels :  Global Level: Global filters will be applied to all the controller and action methods of an application // MvcApplication class contains in Global.asax.cs file public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); } } // FilterConfig.cs located in App_Start folder public class FilterConfig { public static void RegisterGlobalFilters(GlobalFilterCollection filters) { filters.Add(new HandleErrorAttribute()); } } •A markup language is a set of markup tags
  • 15. Filter • Controller Level: Filters can also be applied to the controller class. So, filters will be applicable to all the action method of Controller class if it is applied to a controller class [HandleError] public class HomeController : Controller { public ActionResult Index() { return View(); } } •A markup language is a set of markup tags
  • 16. Filter  Action method level: Apply filters to an individual action method. So, filter will be applicable to that particular action method only. public class HomeController : Controller { [HandleError] public ActionResult Index() { return View(); } }  Filters run in the following order.  Authorization filters, Action filters, Response filters, Exception filters •A markup language is a set of markup tags

Editor's Notes

  • #2: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #3: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #4: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #5: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #6: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #7: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #8: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #9: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #10: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #11: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #12: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #13: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #14: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #15: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #16: Software Outsourcing Company India - http://www.ifourtechnolab.com/