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

What's hot (20)

PDF
Asp.net mvc basic introduction
Bhagath Gopinath
 
PPT
Asp.net.
Naveen Sihag
 
PPT
React js
Jai Santhosh
 
PPTX
Reactjs
Mallikarjuna G D
 
PPTX
ASP.NET MVC Presentation
Volkan Uzun
 
PPT
Angular 8
Sunil OS
 
PPT
J2ee
Prince Soni
 
PPTX
Introduction to Angularjs
Manish Shekhawat
 
PPTX
Getting started with entity framework
Lushanthan Sivaneasharajah
 
PDF
jQuery for beginners
Arulmurugan Rajaraman
 
PDF
REST APIs with Spring
Joshua Long
 
PPTX
Introduction to ASP.NET
Rajkumarsoy
 
PPT
Java Script ppt
Priya Goyal
 
PPT
ASP .net MVC
Divya Sharma
 
PPTX
Spring Web MVC
zeeshanhanif
 
PPTX
[Final] ReactJS presentation
洪 鹏发
 
PPTX
Model view controller (mvc)
M Ahsan Khan
 
PPTX
Introduction to React JS
Arnold Asllani
 
PPTX
Reactjs
Neha Sharma
 
PPT
Java Persistence API (JPA) Step By Step
Guo Albert
 
Asp.net mvc basic introduction
Bhagath Gopinath
 
Asp.net.
Naveen Sihag
 
React js
Jai Santhosh
 
ASP.NET MVC Presentation
Volkan Uzun
 
Angular 8
Sunil OS
 
Introduction to Angularjs
Manish Shekhawat
 
Getting started with entity framework
Lushanthan Sivaneasharajah
 
jQuery for beginners
Arulmurugan Rajaraman
 
REST APIs with Spring
Joshua Long
 
Introduction to ASP.NET
Rajkumarsoy
 
Java Script ppt
Priya Goyal
 
ASP .net MVC
Divya Sharma
 
Spring Web MVC
zeeshanhanif
 
[Final] ReactJS presentation
洪 鹏发
 
Model view controller (mvc)
M Ahsan Khan
 
Introduction to React JS
Arnold Asllani
 
Reactjs
Neha Sharma
 
Java Persistence API (JPA) Step By Step
Guo Albert
 

Similar to Asp.net MVC training session (20)

PPTX
Dot Net Online training in uk and usa
almaandrea
 
PPTX
Dotnet Online Training
Summa Mcclane
 
PPTX
ASP.NET MVC 5 - EF 6 - VS2015
Hossein Zahed
 
PPTX
Asp.net
BALUJAINSTITUTE
 
PDF
Net online training
Monster Courses
 
PPTX
Metaworks4 intro
uEngine Solutions
 
PPTX
Mvc fundamental
Nguyễn Thành Phát
 
PPTX
What's New in .Net 4.5
Malam Team
 
PDF
Cert05 70-487 - developing microsoft azure and web services
DotNetCampus
 
PPTX
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
Speedment, Inc.
 
PPTX
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
Malin Weiss
 
PPTX
Intro to .NET for Government Developers
Frank La Vigne
 
PPTX
Using MVC with Kentico 8
Thomas Robbins
 
PPTX
Cloud architecture patterns and pratices
Gustavo Alzate Sandoval
 
PPTX
OrigoDB - take the red pill
Robert Friberg
 
PPTX
Silicon Valley JUG - How to generate customized java 8 code from your database
Speedment, Inc.
 
PPTX
How to generate customized java 8 code from your database
Speedment, Inc.
 
PPTX
Frameworks Galore: A Pragmatic Review
netc2012
 
PPTX
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
PPTX
SoCal Code Camp 2011 - ASP.NET 4.5
Jon Galloway
 
Dot Net Online training in uk and usa
almaandrea
 
Dotnet Online Training
Summa Mcclane
 
ASP.NET MVC 5 - EF 6 - VS2015
Hossein Zahed
 
Net online training
Monster Courses
 
Metaworks4 intro
uEngine Solutions
 
Mvc fundamental
Nguyễn Thành Phát
 
What's New in .Net 4.5
Malam Team
 
Cert05 70-487 - developing microsoft azure and web services
DotNetCampus
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
Speedment, Inc.
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
Malin Weiss
 
Intro to .NET for Government Developers
Frank La Vigne
 
Using MVC with Kentico 8
Thomas Robbins
 
Cloud architecture patterns and pratices
Gustavo Alzate Sandoval
 
OrigoDB - take the red pill
Robert Friberg
 
Silicon Valley JUG - How to generate customized java 8 code from your database
Speedment, Inc.
 
How to generate customized java 8 code from your database
Speedment, Inc.
 
Frameworks Galore: A Pragmatic Review
netc2012
 
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
SoCal Code Camp 2011 - ASP.NET 4.5
Jon Galloway
 
Ad

Recently uploaded (20)

PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Biography of Daniel Podor.pdf
Daniel Podor
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Ad

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)