mvc from beginner to advance in indian style by - indiandotnet

22
MVC – Beginner to Advance MVC IN INDIAN STYLE BY ABHISHEK SAPKALE A MEMBER OF INDIAN DOTNET

Upload: indiandotnet

Post on 22-Jul-2015

124 views

Category:

Technology


0 download

TRANSCRIPT

MVC – Beginner to Advance

MVC IN INDIAN STYLE BY ABHISHEK SAPKALE A MEMBER OF INDIAN DOTNET

Indiandotnet – Microsoft user group community

http://indiandotnet.wordpress.com

https://facebook.com/indiandotnet

https://sqlraaga.blogspot.com

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

M V C

ASP.Net MVCASP.Net MVC

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.

How works with ASP.Net MVCHow works with ASP.Net MVC

ViewModel or Strongly type model

Business Layer or Model

Data Access Layer

View in ASP.NET MVC

Controller in ASP.NET MVC

AdvantagesAdvantages

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.

Versions of MVCVersions of MVC

MVC - 6

MVC - 5

MVC - 4

MVC - 1

MVC - 2

MVC - 3

ASP.NET MVC VS WEB FORMSASP.NET MVC VS WEB FORMS

ASP.NET Web Forms ASP.NET MVCASP.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.

Demo project startup

Introduction

Project Folder

Model ,View ,Controller

Razor View Engine

Html Helper

Demo project startup

Introduction

Bundle Config

Filter Config

Route Config

WebApi Config

Area in MVC

Style & Scripts Folder

Views

Layouts RenderBody

RenderPage

RenderSection

Styles.Render

Scripts.Render

Sections

Define Layout ViewStart Page

With in view

Return type

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

HTML Helpers

Standard Html Helpers

Strongly Typed HTML Helpers

Template HTML Helpers

URL Helpers

AJAX Helpers

StorageStorage

View Bag

View Data

Temp Data

Session

ControllerController

Routing

Convention based routing

Attribute Routing

Route Constraints

Controller

Action ResultViewResult

PartialViewResult

RedirectResult

RedirectToRouteResult

ContentResult

JsonResult

JavaScriptResult

FileResult

Action MethodsNon-Action Attribute

HttpGet

HttpPost

FilterAuthentication Filter

Authorization Filter

Action Filter

Result Filter

Exception Filter

ModelModel

Data Annotations Server Side Validation

Flash BackFlash Back

Up coming session soon

ThanksIndian dotnet

HTTP://INDIANDOTNET.WORDPRESHTTP://INDIANDOTNET.WORDPRESS.COMS.COM

HTTP://FACEBOOK.COM/INDIANDOHTTP://FACEBOOK.COM/INDIANDOTNETTNET

HTTP://LINKED.IN/HELPERCLASS HTTP://LINKED.IN/HELPERCLASS GROUPGROUP