This document provides an overview of Model-View-Controller (MVC) and ASP.NET MVC frameworks. It discusses the basic concepts of MVC including the model, view and controller components. It then explains how ASP.NET MVC works with models, views, controllers and data access layers. Finally, it demonstrates some key aspects of ASP.NET MVC like routing, views, HTML helpers and controllers.
MVC From Beginner to Advance in Indian Style by - Indiandotnet
1. MVC – Beginner to
Advance
MVC IN INDIAN STYLE BY ABHISHEK SAPKALE A MEMBER OF INDIAN DOTNET
2. Indiandotnet –
Microsoft user
group community
http://indiandotnet.wordpress.com
https://facebook.com/indiandotnet
https://sqlraaga.blogspot.com
3. M V C
“M” “V” “C” stands for “MODEL” “VIEW” “CONTROLLER”.
A Software Design Pattern.
Introduced in 1970s.
It makes it easier to manage complexity.
Separation of concerns(Soc).
Used by Ruby on Rails, Spring Framework, Apple iOS
5. AASSPP..NNeett MMVVCC
ASP.NET MVC is an open source framework built on the top of Microsoft .NET Framework.
Use to build the Web Application Based on MVC
ASP.NET MVC framework is the most customizable and extensible platform shipped by Microsoft.
6. HHooww wwoorrkkss wwiitthh AASSPP..NNeett MMVVCC
ViewModel or Strongly type model
Business Layer or Model
Data Access Layer
View in ASP.NET MVC
Controller in ASP.NET MVC
7. AAddvvaannttaaggeess
TDD
State Less
Front controller pattern
Extensible and pluggable
Full control over application behaviour
ASP.NET features are supported
URL routing mechanism
Support with jquery libraries.
9. AASSPP..NNEETT MMVVCC VVSS WWEEBB FFOORRMMSS
ASP.NET Web Forms ASP.NET MVC
ASP.NET Web Forms uses Page controller. ASP.NET MVC uses Front Controller
approach.
No separation of concerns. Very clean separation of concerns. View
and Controller are neatly separate.
Generally follow URL structure containing
page name.
(E.g.: http://mywebsite.com/default.aspx)
Has rich Routing structure.
(E.g: http://mywebsite.com/home/index)
Follows a traditional event driven
development model.
Asp. Net MVC is a lightweight and follow
MVC pattern based development model.
Contains server controls. Contains Html helpers.
Default state management (like as view
state, session) techniques.
No automatic state management
techniques.
User Controls for code re-usability. Partial Views for code re-usability.
10. Demo project startup
Introduction
Project Folder
Model ,View ,Controller
Razor View Engine
Html Helper
12. Views
Layouts
RenderBody
RenderPage
RenderSection
Styles.Render
Scripts.Render
Sections
Define Layout
ViewStart Page
With in view
Return type
13. Views
Normal View
How to render view - Demo
Partial View
Html.Partial
How to render by jquery
How add on page
Strongly Typed View
How to use it
14. HTML Helpers
Standard Html Helpers
Strongly Typed HTML Helpers
Template HTML Helpers
URL Helpers
AJAX Helpers