SlideShare a Scribd company logo
ASP.NET MVCASP.NET MVC
[M[Modelodel VViewiew CController (MVC)ontroller (MVC)
applications by using theapplications by using the
ASP.NET frameworkASP.NET framework]
Taranjeet Singh
www.ptlsolution.co
m
What is ASP.NET MVC?
Saying simply, ASP.NET MVC is a new
framework from Microsoft that sites over
standard ASP.NET engine.
ASP.NET
ASP.NET MVC
ASP.NET MVC Features
What new does ASP.NET MVC bring in
terms of web architecture?
1. Clear separation of logic: Model, View, Controller
2. Test-Driven Development
3. Full control over HTML and JavaScript
4. Friendly URLs
Model + View + Controller = MVC
ASP.NET MVC provides an alternative to
the ASP.NET “Web Forms” pattern for
creating MVC-based Web applications.
Model
ControllerView
Model objects implement the
logic for the application's
data domain. Often, model
objects retrieve and store the
app state in a database.
Controllers handle
user interaction, work
with the model, and
select a view to render
that displays UI
Views display the
application's user
interface (UI). Typically,
this UI is created from
the model data.
Request
ControllerController
ControllerController
Model
ControllerController
ViewView
ControllerController
ViewView
Response
ControllerController
ViewView
Full control over HTML & JS
In ASP.NET MVC, designed HTML & JS
pages are not more messed up with
“postbacks” and “ViewStates”, which is
specific for “Web-forms” pattern.
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPaA8FDzhjYjBhZjA0ODYyMTM2NBgGBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUhY3RsMDAkaGVhZGVyJHVjTWFp
bk1lbnUkc2VhcmNoQnRuBTdjdGwwMCRNYWluQ29udGVudCRycHRWaWRlbyRjdGwwMyRwcmVzZW50YXRpb25DYXJkJG11bHRp" />
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['aspnetForm'];
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
Friendly URLs
MVC binds web paths to the logical URLs
rather than to the physical files.
C:InetpubwwwrootWebSiteProducts.aspx
http://www.website.com/Products.aspx?name=Meat
http://www.website.com/Products/Meat
Physical location:
ASP.NET style:
MVC style:
Routing
R => the hidden characterMVC + R
1. Maps incoming URLs to the application and routes them to the right
Controller’s Action method to execute them
2. Happens in RegisterRoutes function in the global.asax file
Routing
Don’t settle for…
/ProductsDetails.aspx?CategoryID=123
When you can easily have…
/Product/Details/123/
Or whatever else makes sense…
Routing
To customize routing rules
How does ASP.NET MVC looks like?
ASP.NET MVC installs a new type of web
project into VS2013.
How does ASP.NET MVC looks like?
A newly created project has an ASP.NET
MVC specific directory structure.
App_Data folder is the physical store for data.
Content folder keeps files such as scripts, CSS, images, and so on.
Controllers folder is the location for controllers. The MVC framework
requires the names of all controllers to end with "Controller"—for
example, HomeController, LoginController, or ProductController.
Models stores classes that handle application business logic.
Scripts folder is for script files that support the application. By
default, this folder contains AJAX script files and the JQuery library.
Views is the recommended location for views. Views use .aspx,
.ascx, and .master files, in addition to any other files that are related
to rendering views.
Logic UI
Test-Driven Development
Since the UI is completely separated from
the business logic, it’s now easy to write
Unit Tests for the ASP.NET MVC
application.
Controller
Unit Tests that cover
User Actions and Data Model
User Interface Data Objects
Conclusion
ASP.NET MVC supports pure MVC pattern, the
same development pattern Rails are based on.
The advantages of ASP.NET MVC applications:
1. It makes it easier to manage complexity by dividing an application into
the model, the view, and the controller.
2. It does not use view state or server-based forms.
3. It uses a Front Controller pattern that processes Web application
requests through a single controller. This enables you to design an
application that supports a rich routing infrastructure with friendly
URLs.
4. It provides better support for test-driven development (TDD).
5. It works well for Web applications that are supported by large teams of
developers and Web designers who need a high degree of control
over the application behavior.
Web Links to Additional Resources
• http://www.asp.net/mvc - official site
• http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-
framework-part-1.aspx - development basics on ASP.NET MVC
• http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-
framework-part-2-url-routing.aspx - URL routing used in ASP.NET
MVC
• http://weblogs.asp.net/scottgu/archive/2007/12/06/asp-net-mvc-
framework-part-3-passing-viewdata-from-controllers-to-views.aspx
- interaction between Controllers and Views
• http://weblogs.asp.net/scottgu/archive/2007/12/09/asp-net-mvc-
framework-part-4-handling-form-edit-and-post-scenarios.aspx -
managing form input data
Asp.net mvc

More Related Content

PPTX
Session 1
Asif Atick
 
PDF
ASP.Net | Sabin Saleem
SaBin SaleEm
 
PPT
Asp.net mvc
Naga Harish M
 
PPT
ASP .net MVC
Divya Sharma
 
PPT
MVC ppt presentation
Bhavin Shah
 
PPT
MSDN - ASP.NET MVC
Maarten Balliauw
 
PPTX
Asp.net mvc presentation by Nitin Sawant
Nitin S
 
PPTX
Introduction to mvc architecture
ravindraquicsolv
 
Session 1
Asif Atick
 
ASP.Net | Sabin Saleem
SaBin SaleEm
 
Asp.net mvc
Naga Harish M
 
ASP .net MVC
Divya Sharma
 
MVC ppt presentation
Bhavin Shah
 
MSDN - ASP.NET MVC
Maarten Balliauw
 
Asp.net mvc presentation by Nitin Sawant
Nitin S
 
Introduction to mvc architecture
ravindraquicsolv
 

What's hot (20)

ODP
Mvc
abhigad
 
PPTX
ASP .NET MVC
eldorina
 
PDF
Asp.net mvc basic introduction
Bhagath Gopinath
 
PDF
Dot net interview questions and asnwers
kavinilavuG
 
PPT
MVC Architecture in ASP.Net By Nyros Developer
Nyros Technologies
 
PPTX
ASP.NET MVC.
Ni
 
PPTX
ASP.NET MVC 5 - EF 6 - VS2015
Hossein Zahed
 
PPTX
Asp.net MVC training session
Hrichi Mohamed
 
PPTX
MVC 4
Vasilios Kuznos
 
PPTX
MVC Framework
Ashton Feller
 
PPTX
ASP.NET MVC Presentation
Volkan Uzun
 
PPT
Asp.net mvc
Phuc Le Cong
 
PPT
ASP.NET MVC Presentation
ivpol
 
PPSX
Asp.net mvc
Er. Kamal Bhusal
 
PPTX
Mortal Kombat! ASP.NET MVC vs ASP.NET Webforms – ASP.NET MVC is amazing
Tom Walker
 
PPT
MVC Pattern. Flex implementation of MVC
Anton Krasnoshchok
 
PDF
Asp 1a-aspnetmvc
Fajar Baskoro
 
ODP
What is MVC?
Dom Cimafranca
 
PPT
Mvc architecture
Surbhi Panhalkar
 
PPTX
Mvc fundamental
Nguyễn Thành Phát
 
Mvc
abhigad
 
ASP .NET MVC
eldorina
 
Asp.net mvc basic introduction
Bhagath Gopinath
 
Dot net interview questions and asnwers
kavinilavuG
 
MVC Architecture in ASP.Net By Nyros Developer
Nyros Technologies
 
ASP.NET MVC.
Ni
 
ASP.NET MVC 5 - EF 6 - VS2015
Hossein Zahed
 
Asp.net MVC training session
Hrichi Mohamed
 
MVC Framework
Ashton Feller
 
ASP.NET MVC Presentation
Volkan Uzun
 
Asp.net mvc
Phuc Le Cong
 
ASP.NET MVC Presentation
ivpol
 
Asp.net mvc
Er. Kamal Bhusal
 
Mortal Kombat! ASP.NET MVC vs ASP.NET Webforms – ASP.NET MVC is amazing
Tom Walker
 
MVC Pattern. Flex implementation of MVC
Anton Krasnoshchok
 
Asp 1a-aspnetmvc
Fajar Baskoro
 
What is MVC?
Dom Cimafranca
 
Mvc architecture
Surbhi Panhalkar
 
Mvc fundamental
Nguyễn Thành Phát
 
Ad

Viewers also liked (17)

DOCX
Online assignment
lekshmyrajan91
 
PDF
How I Define Living Globally
raye23
 
PDF
Poligonal (construccion de redes)
Carlita Bonita
 
PDF
Kti linda wati
KTIMELDAWATI
 
PDF
WT Volleyball Game Notes (9-10-15)
West Texas A&M
 
PPTX
Zuni stone
Katie Lawson
 
DOC
Marilee Welch Resume 2015
Marilee Welch
 
PPTX
Multimedia
Mustafa_Sabuwala
 
PPTX
Amor y amistad
yeimygil01
 
DOCX
VAMSI KRISHNA RAJULAPUDI_Resume_Scripting
VAMSI R
 
PDF
“Bon símptoma”. De moment, 13 morts als bous al carrer en un sol estiu.
Jesús Frare Garcia
 
PPTX
engagement 9_10_15
Sida Ly-Xiong
 
PDF
PS1_2014_2012B5A7521P_2012B5A7848P_2012B4A7958H
Saurabh Kumar
 
DOC
C -users-mmusa-desktop-exams-final exam (1)
Saad Darras
 
PDF
On Dadaji - Vol II
Truth Within
 
PPT
Tema 1 propaganda15
Xosé Baamonde
 
PPTX
Day4 honors curriculum-advising
Seth Porter, MA, MLIS
 
Online assignment
lekshmyrajan91
 
How I Define Living Globally
raye23
 
Poligonal (construccion de redes)
Carlita Bonita
 
Kti linda wati
KTIMELDAWATI
 
WT Volleyball Game Notes (9-10-15)
West Texas A&M
 
Zuni stone
Katie Lawson
 
Marilee Welch Resume 2015
Marilee Welch
 
Multimedia
Mustafa_Sabuwala
 
Amor y amistad
yeimygil01
 
VAMSI KRISHNA RAJULAPUDI_Resume_Scripting
VAMSI R
 
“Bon símptoma”. De moment, 13 morts als bous al carrer en un sol estiu.
Jesús Frare Garcia
 
engagement 9_10_15
Sida Ly-Xiong
 
PS1_2014_2012B5A7521P_2012B5A7848P_2012B4A7958H
Saurabh Kumar
 
C -users-mmusa-desktop-exams-final exam (1)
Saad Darras
 
On Dadaji - Vol II
Truth Within
 
Tema 1 propaganda15
Xosé Baamonde
 
Day4 honors curriculum-advising
Seth Porter, MA, MLIS
 
Ad

Similar to Asp.net mvc (20)

PDF
Jinal desai .net
rohitkumar1987in
 
PPTX
ASP.NET Presentation
Rasel Khan
 
PPTX
Technoligent providing custom ASP.NET MVC development services
Aaron Jacobson
 
PDF
Aspnetmvc 1
Fajar Baskoro
 
PPTX
An overview of microsoft mvc dot net
neha sharma
 
PPTX
Asp.net With mvc handson
Prashant Kumar
 
PPTX
Introduction-to-ASPNET-Core ASP.NET.pptx
MAHERMOHAMED27
 
PPTX
Head first asp.net mvc 2.0 rtt
Lanvige Jiang
 
PPTX
Mvc Brief Overview
rainynovember12
 
PPTX
Asp.net mvc 5 course module 1 overview
Sergey Seletsky
 
PDF
Best Institute for ASP NET MVC Course in India
IT DESK INDIA
 
PPT
Struts(mrsurwar) ppt
mrsurwar
 
PDF
Asp.net Mvc Introduction
Vishal Sharma
 
PPTX
ASP.NET MVC Fundamental
ldcphuc
 
PPTX
Mvc
Furqan Ashraf
 
PPTX
Asp.net c# MVC-5 Training-Day-1 of Day-9
AHM Pervej Kabir
 
PPTX
MVC 6 Introduction
Sudhakar Sharma
 
PPTX
Intro ASP MVC
KrishnaPPatel
 
PPTX
Simple mvc4 prepared by gigin krishnan
Gigin Krishnan
 
PPTX
MVC - Introduction
Sudhakar Sharma
 
Jinal desai .net
rohitkumar1987in
 
ASP.NET Presentation
Rasel Khan
 
Technoligent providing custom ASP.NET MVC development services
Aaron Jacobson
 
Aspnetmvc 1
Fajar Baskoro
 
An overview of microsoft mvc dot net
neha sharma
 
Asp.net With mvc handson
Prashant Kumar
 
Introduction-to-ASPNET-Core ASP.NET.pptx
MAHERMOHAMED27
 
Head first asp.net mvc 2.0 rtt
Lanvige Jiang
 
Mvc Brief Overview
rainynovember12
 
Asp.net mvc 5 course module 1 overview
Sergey Seletsky
 
Best Institute for ASP NET MVC Course in India
IT DESK INDIA
 
Struts(mrsurwar) ppt
mrsurwar
 
Asp.net Mvc Introduction
Vishal Sharma
 
ASP.NET MVC Fundamental
ldcphuc
 
Asp.net c# MVC-5 Training-Day-1 of Day-9
AHM Pervej Kabir
 
MVC 6 Introduction
Sudhakar Sharma
 
Intro ASP MVC
KrishnaPPatel
 
Simple mvc4 prepared by gigin krishnan
Gigin Krishnan
 
MVC - Introduction
Sudhakar Sharma
 

Recently uploaded (20)

PDF
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PDF
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PDF
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PDF
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
PDF
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
PDF
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
PDF
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PPT
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
Activate_Methodology_Summary presentatio
annapureddyn
 
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
Protecting the Digital World Cyber Securit
dnthakkar16
 

Asp.net mvc

  • 1. ASP.NET MVCASP.NET MVC [M[Modelodel VViewiew CController (MVC)ontroller (MVC) applications by using theapplications by using the ASP.NET frameworkASP.NET framework] Taranjeet Singh www.ptlsolution.co m
  • 2. What is ASP.NET MVC? Saying simply, ASP.NET MVC is a new framework from Microsoft that sites over standard ASP.NET engine. ASP.NET ASP.NET MVC
  • 3. ASP.NET MVC Features What new does ASP.NET MVC bring in terms of web architecture? 1. Clear separation of logic: Model, View, Controller 2. Test-Driven Development 3. Full control over HTML and JavaScript 4. Friendly URLs
  • 4. Model + View + Controller = MVC ASP.NET MVC provides an alternative to the ASP.NET “Web Forms” pattern for creating MVC-based Web applications. Model ControllerView Model objects implement the logic for the application's data domain. Often, model objects retrieve and store the app state in a database. Controllers handle user interaction, work with the model, and select a view to render that displays UI Views display the application's user interface (UI). Typically, this UI is created from the model data.
  • 10. Full control over HTML & JS In ASP.NET MVC, designed HTML & JS pages are not more messed up with “postbacks” and “ViewStates”, which is specific for “Web-forms” pattern. <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPaA8FDzhjYjBhZjA0ODYyMTM2NBgGBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUhY3RsMDAkaGVhZGVyJHVjTWFp bk1lbnUkc2VhcmNoQnRuBTdjdGwwMCRNYWluQ29udGVudCRycHRWaWRlbyRjdGwwMyRwcmVzZW50YXRpb25DYXJkJG11bHRp" /> <script type="text/javascript"> //<![CDATA[ var theForm = document.forms['aspnetForm']; function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } //]]> </script>
  • 11. Friendly URLs MVC binds web paths to the logical URLs rather than to the physical files. C:InetpubwwwrootWebSiteProducts.aspx http://www.website.com/Products.aspx?name=Meat http://www.website.com/Products/Meat Physical location: ASP.NET style: MVC style:
  • 12. Routing R => the hidden characterMVC + R 1. Maps incoming URLs to the application and routes them to the right Controller’s Action method to execute them 2. Happens in RegisterRoutes function in the global.asax file
  • 13. Routing Don’t settle for… /ProductsDetails.aspx?CategoryID=123 When you can easily have… /Product/Details/123/ Or whatever else makes sense…
  • 15. How does ASP.NET MVC looks like? ASP.NET MVC installs a new type of web project into VS2013.
  • 16. How does ASP.NET MVC looks like? A newly created project has an ASP.NET MVC specific directory structure. App_Data folder is the physical store for data. Content folder keeps files such as scripts, CSS, images, and so on. Controllers folder is the location for controllers. The MVC framework requires the names of all controllers to end with "Controller"—for example, HomeController, LoginController, or ProductController. Models stores classes that handle application business logic. Scripts folder is for script files that support the application. By default, this folder contains AJAX script files and the JQuery library. Views is the recommended location for views. Views use .aspx, .ascx, and .master files, in addition to any other files that are related to rendering views.
  • 18. Test-Driven Development Since the UI is completely separated from the business logic, it’s now easy to write Unit Tests for the ASP.NET MVC application. Controller Unit Tests that cover User Actions and Data Model User Interface Data Objects
  • 19. Conclusion ASP.NET MVC supports pure MVC pattern, the same development pattern Rails are based on. The advantages of ASP.NET MVC applications: 1. It makes it easier to manage complexity by dividing an application into the model, the view, and the controller. 2. It does not use view state or server-based forms. 3. It uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure with friendly URLs. 4. It provides better support for test-driven development (TDD). 5. It works well for Web applications that are supported by large teams of developers and Web designers who need a high degree of control over the application behavior.
  • 20. Web Links to Additional Resources • http://www.asp.net/mvc - official site • http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc- framework-part-1.aspx - development basics on ASP.NET MVC • http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc- framework-part-2-url-routing.aspx - URL routing used in ASP.NET MVC • http://weblogs.asp.net/scottgu/archive/2007/12/06/asp-net-mvc- framework-part-3-passing-viewdata-from-controllers-to-views.aspx - interaction between Controllers and Views • http://weblogs.asp.net/scottgu/archive/2007/12/09/asp-net-mvc- framework-part-4-handling-form-edit-and-post-scenarios.aspx - managing form input data