Fast Track introduction to ASP.NET MVC
Upcoming SlideShare
Loading in...5
×
 

Fast Track introduction to ASP.NET MVC

on

  • 210 views

Fast Track introduction to ASP.NET MVC

Fast Track introduction to ASP.NET MVC

Statistics

Views

Total Views
210
Views on SlideShare
205
Embed Views
5

Actions

Likes
0
Downloads
10
Comments
1

2 Embeds 5

https://twitter.com 4
https://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Fast Track introduction to ASP.NET MVC Fast Track introduction to ASP.NET MVC Presentation Transcript

    • *Source: http://www.dilbert.com/ We will start in few minutes…
    • Fast track introduction to ASP.NET MVC -Ankit Kashyap (Analyst Programmer) ankit.Kashyap@wipro.com
    • About Me • Proud Wiproite from last 6 yrs. • Works as Analyst Programmer for Wipro MS-AppC team • Web developer (+ Azure, SQL/EF; Windows Store and xamarin/android) • @ankitwww www.linkedin.com/in/ankitwww/
    • This session • Prerequisites:  A little prior knowledge of ASP.NET Web form  C#  Software – Visual Studio 2012/2013 express edition • Slides Available @ http://www.slideshare.net/AnkitKashyap/fast-track-introduction-to-aspnet-mvc • Content level – Beginners • Demo based!! Slides for your notes.
    • Agenda • The MVC Pattern • ASP.NET MVC vs Web Form • ASP.NET MVC Routing • Controllers and Actions • Razor Views • HTML Helpers and Partial Views • Unit Testing • General Tips and best practices
    • I love ASPX! Seriously?? • Let’s do a demo! • Make a ASP.NET Web form solution • ASPX vs the real web page
    • ASP.NET Web forms • Abstract away the web! • Focus on Server side processing • Code behind and Server control • Table => GridView • Click events replaces “Post” operation • Originally design from/for late 90s technologies • Now web standards have strengthened • Client side programming on the rise
    • ASP.NET MVC – Design goals • Does not replace web forms! An alternative… • Still runs on ASP.NET • All awesomeness still available – modules, handlers, master pages, session state, Caching, auth. • Embrace the web • No illusions of state – No Page lifecycle • Clean HTML and clean URLs • Separation of concerns!!! – You will love it! • Testable – Big win
    • MVC pattern
    • How it serves Requests? • Controller contains Action methods • Every Action method can return a View (and raw json and other formats)
    • MVC Routing • Routing is the magic component! • Directs incoming requests to an MVC Controller • Defines routes during application startup • Map URLs to control action with parameters • System.Web.Routing Binary – Part of ASP.NET
    • Controller • Heart of MVC • Contains public method called as Actions • Method invokes by ASP.NET once routing decides the proper path • Returns an ActionResult – Tells the framework what to do next
    • View • Strongly typed! • How we intermingled C# and HTML? • Razor view engine – converts C# into actual HMTL @ Server
    • Demo Time!!!
    • Model • Contains business/domain logic • Doesn’t bother about presentation of Data • May (or may not) contains database access logic • Server side validation for Business logic Demo: Creating a model from POCO classes
    • HTML Helper & ViewBag • Quick, clean and short way • Helpers available for frequently used html elements • ViewBag contains Key-Value dictionary pairs. • Can be passed from Action to View
    • Partial Views Quick Demo
    • Layout and _ViewStart • Layout views are “master pages” • _ViewStart.cshtml – Code inside this view executes before every view renders
    • Further Resources • http://www.asp.net/mvc • Tutorials - http://www.asp.net/mvc/tutorials • http://www.codeproject.com/Articles/207797/Learn-MVC-Model- View-Controller-step-by-step-in
    • That’s all!! @ankitwww www.linkedin.com/in/ankitwww/ http://www.slideshare.net/AnkitKashyap/fast-track- introduction-to-aspnet-mvc