SlideShare a Scribd company logo
Asp.net MVC training session
• A design Pattern (Methodology)
• Invented by Smalltalk programmer (Trygve
Reenskaug 1979).
• Separation of Concerns / Single Responsibility
Principle
• More easily testable
M
Model
V
View
C
Controller
• Representation of domain data
• Business Logic
• Persistence mechanisms
• User Interface
• The representation of Model
• An intermediary between Model and View
• Application’s Brain (Handle user requests, bind
Data, return views)
Ok
C
Controller
M
Model
V
View
CreateInvoice (fact)
Create invoice (data)
fact = new Invoice ()
LatestInvoices ()
return view ("Last-Invoices", ListFact[])
ListFact[]
HTML
• Part of ASP.NET
• Not an upgrade or replacement for Web Forms
ASP.NET
Webforms MVC Webpages
• No server controls
• No ViewState
• No Code Behind
• Full control over html
• Unit Testing
• Separation of application tasks (No code Behind)
• Flexibility and Extensibility
• Friendly URLs (Routing)
• Scalability and Performance
• Supports existing ASP.NET features
(Authentication, Membership, roles, output
caching,…)
• Natural integration with Ajax
Asp.net MVC training session
• View Engines
o Aspx
o Razor
• Layout
• Partial View
• Section
• HtmlHelper, AjaxHelper
• ActionLink
@Html.ActionLink(“Modifier", “Edit“, new {Id=3})
<a href="/Product/Edit/6">Modifier</a>
• Form Elements (Form, TextBox, Hidden,….)
@Html.TextBox(“Nom")
<input id=" Nom " type="text" value="" name=" Nom ">
• DropDownList
var db = new NorthwindDataContext();
IEnumerable<SelectListItem> items = db.Categories
.Select(c => new SelectListItem { Value = c.CategoryID.ToString(), Text = c.CategoryName });
ViewBag.Categories = items;
@Html.DropDownList("CategoryID",
(IEnumerable<SelectListItem>) ViewBag.Categories)
• Ajax ActionLink
@Ajax.ActionLink("Get Time", "GetTime", new AjaxOptions () {
UpdateTargetId="divTorefresh",
HttpMethod="GET"
})
<a href="/Home/GetTime" data-ajax-update="#divTorefresh"
data-ajax-mode="after" data-ajax-method="GET" data-
ajax="true">Get Time</a>
Asp.net MVC training session
• Action Results
• Filters
• Caching
• ViewResult
• PartialViewResult
• JsonResult
• JavaScriptResult
• ContentResult
• FileResult
• RedirectResult
• Authorization filters
• Action filters
• Result filters
• Exception filters
[OutputCache(Duration=3600)]
Public ActionResult GetListCountries()
{
// Logic to get countries list
}
[OutputCache(Duration=3600, VaryByParam = "countryId")]
Public ActionResult GetListRegions(int countryId)
{
// Logic to get regions list
}
Asp.net MVC training session
• Annotation
• Validation(Client Side & Server Side)
• Required
• DisplayName
• Range
• DataType
• StringLength
Asp.net MVC training session
• Open source package manager for the .NET
Framework
• Provide the ability to produce and consume packages
Asp.net MVC training session
• Bundling & Minification
• Web Api
• Template Mobile
• Asynchronous
• RealTime avec SignalR
Improve JavaScript and CSS files loading
• Minimize the Number of requests (Bundle in
one File)
• Reduce the size of files (remove spaces, enters
and comments)
Fully customizable and extensible
Asp.net MVC training session
Asp.net MVC training session
Asp.net MVC training session
• Entity Framework
• Database First
• Model First
• Code First
• Object-relational mapping (ORM) Framework
• Gives an automated mechanism for Data Access
• Manipulate Data as Object
• Reduce hard coded Query
• Have inheritance relationships between entities
• Performing basic CRUD(Create, Read, Update, Delete)
Asp.net MVC training session
• Existing DataBase
• Generate .Edmx From DataBase
• Use ObjectContext & DBContext
• Use T4 template (POCO)
• Empty Edmx Model
• Design th DB Schema
• Generate DataBase From Model
• Create Domain Models (Class)
• Generate DataBase From Domain Models
• Full Control Over Code
• No Autogenerated code
Asp.net MVC training session
• User Authentification
• Authorization
• Cross-site request forgery
• Cross-site Scripting
• Forms Authentification
• Cookies
• Windows Authentification
• Windows Session
• Via IIS
• OAuth
• Facebook, google, Hotmail, twitter, etc.
• Role-based Authorization
• [Authorize(Roles = "Admin, Super User")]
• [Authorize(Users = "Betty, Johnny")]
• Malicious attack (Cross Domain)
• Using Forms
• Session hijacking
• Malicious attack Using Script Injection
• Inject Code Inside Pages
Asp.net MVC training session
• Design pattern
• Removal of hard-coded dependencies
• Giving an object its instance variables (Dynamically)
Asp.net MVC training session
Asp.net MVC training session

More Related Content

PPT
ASP.NET MVC Presentation
PPTX
Introduction to mvc architecture
PPT
MVC ppt presentation
PDF
Introduction to ASP.NET Core
PDF
What is Dependency Injection in Spring Boot | Edureka
PPT
Why MVC?
PPTX
Asp.Net Core MVC with Entity Framework
PPTX
Dependency injection - the right way
ASP.NET MVC Presentation
Introduction to mvc architecture
MVC ppt presentation
Introduction to ASP.NET Core
What is Dependency Injection in Spring Boot | Edureka
Why MVC?
Asp.Net Core MVC with Entity Framework
Dependency injection - the right way

What's hot (20)

PDF
Spring MVC Framework
PPTX
Spring boot
PPTX
ASP.NET Core MVC + Web API with Overview
PDF
Model View Controller (MVC)
PDF
Spring Framework - AOP
PDF
Asp.Net Core MVC , Razor page , Entity Framework Core
PPTX
Model view controller (mvc)
PPTX
PPTX
ASP.NET MVC Presentation
PDF
Spring boot introduction
PPT
Mvc architecture
PPTX
ASP.NET MVC.
 
PDF
MVC Architecture
PPT
Java database connectivity
PPTX
Introduction to Node.js
PPTX
Introduction to spring boot
PPTX
Introduction à spring boot
PDF
MVC architecture
PPTX
Introduction to Spring Boot
Spring MVC Framework
Spring boot
ASP.NET Core MVC + Web API with Overview
Model View Controller (MVC)
Spring Framework - AOP
Asp.Net Core MVC , Razor page , Entity Framework Core
Model view controller (mvc)
ASP.NET MVC Presentation
Spring boot introduction
Mvc architecture
ASP.NET MVC.
 
MVC Architecture
Java database connectivity
Introduction to Node.js
Introduction to spring boot
Introduction à spring boot
MVC architecture
Introduction to Spring Boot
Ad

Similar to Asp.net MVC training session (20)

PPTX
Dotnet Online Training
PPTX
Dot Net Online training in uk and usa
PPTX
ASP.NET MVC 5 - EF 6 - VS2015
PPTX
PDF
Net online training
PPTX
Metaworks4 intro
PPTX
Mvc fundamental
PPTX
What's New in .Net 4.5
PDF
Cert05 70-487 - developing microsoft azure and web services
PPTX
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
PPTX
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
PPTX
Intro to .NET for Government Developers
PDF
Asp.net mvc basic introduction
PPTX
Using MVC with Kentico 8
PPTX
Cloud architecture patterns and pratices
PPTX
OrigoDB - take the red pill
PPTX
Silicon Valley JUG - How to generate customized java 8 code from your database
PPTX
How to generate customized java 8 code from your database
PPTX
Frameworks Galore: A Pragmatic Review
PPTX
Getting started with MVC 5 and Visual Studio 2013
Dotnet Online Training
Dot Net Online training in uk and usa
ASP.NET MVC 5 - EF 6 - VS2015
Net online training
Metaworks4 intro
Mvc fundamental
What's New in .Net 4.5
Cert05 70-487 - developing microsoft azure and web services
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
Intro to .NET for Government Developers
Asp.net mvc basic introduction
Using MVC with Kentico 8
Cloud architecture patterns and pratices
OrigoDB - take the red pill
Silicon Valley JUG - How to generate customized java 8 code from your database
How to generate customized java 8 code from your database
Frameworks Galore: A Pragmatic Review
Getting started with MVC 5 and Visual Studio 2013
Ad

Recently uploaded (20)

PPTX
How to Build Crypto Derivative Exchanges from Scratch.pptx
PPTX
ABU RAUP TUGAS TIK kelas 8 hjhgjhgg.pptx
PDF
KodekX | Application Modernization Development
PPTX
Belt and Road Supply Chain Finance Blockchain Solution
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Enable Enterprise-Ready Security on IBM i Systems.pdf
PDF
Top Generative AI Tools for Patent Drafting in 2025.pdf
PDF
DevOps & Developer Experience Summer BBQ
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
PDF
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
PDF
Dell Pro 14 Plus: Be better prepared for what’s coming
PDF
Smarter Business Operations Powered by IoT Remote Monitoring
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Reimagining Insurance: Connected Data for Confident Decisions.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
How AI Agents Improve Data Accuracy and Consistency in Due Diligence.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
ai-archetype-understanding-the-personality-of-agentic-ai.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
How to Build Crypto Derivative Exchanges from Scratch.pptx
ABU RAUP TUGAS TIK kelas 8 hjhgjhgg.pptx
KodekX | Application Modernization Development
Belt and Road Supply Chain Finance Blockchain Solution
GamePlan Trading System Review: Professional Trader's Honest Take
Enable Enterprise-Ready Security on IBM i Systems.pdf
Top Generative AI Tools for Patent Drafting in 2025.pdf
DevOps & Developer Experience Summer BBQ
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
Dell Pro 14 Plus: Be better prepared for what’s coming
Smarter Business Operations Powered by IoT Remote Monitoring
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Reimagining Insurance: Connected Data for Confident Decisions.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
How AI Agents Improve Data Accuracy and Consistency in Due Diligence.pdf
Understanding_Digital_Forensics_Presentation.pptx
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
ai-archetype-understanding-the-personality-of-agentic-ai.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto

Asp.net MVC training session

  • 2. • A design Pattern (Methodology) • Invented by Smalltalk programmer (Trygve Reenskaug 1979). • Separation of Concerns / Single Responsibility Principle • More easily testable
  • 3. M Model V View C Controller • Representation of domain data • Business Logic • Persistence mechanisms • User Interface • The representation of Model • An intermediary between Model and View • Application’s Brain (Handle user requests, bind Data, return views)
  • 4. Ok C Controller M Model V View CreateInvoice (fact) Create invoice (data) fact = new Invoice () LatestInvoices () return view ("Last-Invoices", ListFact[]) ListFact[] HTML
  • 5. • Part of ASP.NET • Not an upgrade or replacement for Web Forms ASP.NET Webforms MVC Webpages
  • 6. • No server controls • No ViewState • No Code Behind • Full control over html • Unit Testing
  • 7. • Separation of application tasks (No code Behind) • Flexibility and Extensibility • Friendly URLs (Routing) • Scalability and Performance • Supports existing ASP.NET features (Authentication, Membership, roles, output caching,…) • Natural integration with Ajax
  • 9. • View Engines o Aspx o Razor • Layout • Partial View • Section • HtmlHelper, AjaxHelper
  • 10. • ActionLink @Html.ActionLink(“Modifier", “Edit“, new {Id=3}) <a href="/Product/Edit/6">Modifier</a> • Form Elements (Form, TextBox, Hidden,….) @Html.TextBox(“Nom") <input id=" Nom " type="text" value="" name=" Nom ">
  • 11. • DropDownList var db = new NorthwindDataContext(); IEnumerable<SelectListItem> items = db.Categories .Select(c => new SelectListItem { Value = c.CategoryID.ToString(), Text = c.CategoryName }); ViewBag.Categories = items; @Html.DropDownList("CategoryID", (IEnumerable<SelectListItem>) ViewBag.Categories)
  • 12. • Ajax ActionLink @Ajax.ActionLink("Get Time", "GetTime", new AjaxOptions () { UpdateTargetId="divTorefresh", HttpMethod="GET" }) <a href="/Home/GetTime" data-ajax-update="#divTorefresh" data-ajax-mode="after" data-ajax-method="GET" data- ajax="true">Get Time</a>
  • 14. • Action Results • Filters • Caching
  • 15. • ViewResult • PartialViewResult • JsonResult • JavaScriptResult • ContentResult • FileResult • RedirectResult
  • 16. • Authorization filters • Action filters • Result filters • Exception filters
  • 17. [OutputCache(Duration=3600)] Public ActionResult GetListCountries() { // Logic to get countries list } [OutputCache(Duration=3600, VaryByParam = "countryId")] Public ActionResult GetListRegions(int countryId) { // Logic to get regions list }
  • 20. • Required • DisplayName • Range • DataType • StringLength
  • 22. • Open source package manager for the .NET Framework • Provide the ability to produce and consume packages
  • 24. • Bundling & Minification • Web Api • Template Mobile • Asynchronous • RealTime avec SignalR
  • 25. Improve JavaScript and CSS files loading • Minimize the Number of requests (Bundle in one File) • Reduce the size of files (remove spaces, enters and comments) Fully customizable and extensible
  • 29. • Entity Framework • Database First • Model First • Code First
  • 30. • Object-relational mapping (ORM) Framework • Gives an automated mechanism for Data Access • Manipulate Data as Object • Reduce hard coded Query • Have inheritance relationships between entities • Performing basic CRUD(Create, Read, Update, Delete)
  • 32. • Existing DataBase • Generate .Edmx From DataBase • Use ObjectContext & DBContext • Use T4 template (POCO)
  • 33. • Empty Edmx Model • Design th DB Schema • Generate DataBase From Model
  • 34. • Create Domain Models (Class) • Generate DataBase From Domain Models • Full Control Over Code • No Autogenerated code
  • 36. • User Authentification • Authorization • Cross-site request forgery • Cross-site Scripting
  • 37. • Forms Authentification • Cookies • Windows Authentification • Windows Session • Via IIS • OAuth • Facebook, google, Hotmail, twitter, etc.
  • 38. • Role-based Authorization • [Authorize(Roles = "Admin, Super User")] • [Authorize(Users = "Betty, Johnny")]
  • 39. • Malicious attack (Cross Domain) • Using Forms • Session hijacking
  • 40. • Malicious attack Using Script Injection • Inject Code Inside Pages
  • 42. • Design pattern • Removal of hard-coded dependencies • Giving an object its instance variables (Dynamically)