0
Getting Started with ASP.NET MVC <br />
Housekeeping<br />Stuttering is a communication disorder involving disruptions, or “disfluencies,” in a person’s speech.<b...
HattanShobokshi<br />Senior Software Engineer<br />www.hattanshobokshi.com<br />hattan@gmail.com<br />http://speakerrate.c...
Goals for this talk<br /> Present an overview of ASP.NET MVC<br />MVC vsWebforms. Why?<br />What is the MVC paradigm?<br /...
A new web development framework that allows you to develop web applications on the Microsoft stack using an MVC Architectu...
What is MVC?<br />
Why should I use ASP.NET MVC? <br />Testability<br />Model Binder is awesome!<br />No Viewstate<br />SEO friendly url’s<br...
ASP.NET Web Forms<br />Traditional urlhttp://www.yoursite.com/admin/menu.aspx<br />
ASP.NET MVC<br />http://www.yoursite.com/admin/menu<br />Admin is not a folder, but a class called AdminController<br />Me...
DEMO<br />
Routing<br />Route engine parses url’s, extracts any data and sends it off to controller<br />Create extremely customizabl...
Model <br />The model is the representation of your data.<br />Business Logic<br />
Views<br />No Code behind<br />Action methods by default call views with the same name. (Convention over configuration)<br...
Html Helpers<br />Html helpers are extension methods that generate html. @Html.TextBox(“Name”,”Bob”)<br />Html helpers are...
Model Binding<br />Takes data from an html form and creates an object.<br />No need to write plumbing code <br />
Best Practices<br />Never include a hard reference in the view(eg <script src=“../js/jquery.js”></script>)instead use url....
Where can I get it?<br />http://www.asp.net/mvc/download/<br />http://www.microsoft.com/express/Web/<br />
Resources<br />http://www.asp.net/learn/mvc/<br />http://www.asp.net/learn/mvc-videos/<br />Pro ASP.NET MVC Framework by S...
What did we just talk about?<br /> Present an overview of ASP.NET MVC<br /> MVC vsWebforms. Why?<br />What is the MVC para...
The End<br />Thank you!<br />
Upcoming SlideShare
Loading in...5
×

Getting Started with ASP.NET MVC

1,566

Published on

This is an introductory session that will give you an overview of asp.net mvc. We'll examine some of the basic principles behind the framework and contrast it with asp.net webforms. The session will cover topics such as model binding, routing and rad development using asp.net mvc.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,566
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
78
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Controller gets data from the model, Gives it to a view.Controller doesn’t care where model gets data, and likewise controller doesn’t care how the view renders.Each component only cares about itself. Easy to swap out.Benefits :Separation of ConcernsTestabilityEasy to modifyLack of ComplexityFlow:Request comes through. Controller class handles the request, fetching data from the model. Controller then sends that data to the View and the result is given to the framework for rendering
  • Transcript of "Getting Started with ASP.NET MVC"

    1. 1. Getting Started with ASP.NET MVC <br />
    2. 2. Housekeeping<br />Stuttering is a communication disorder involving disruptions, or “disfluencies,” in a person’s speech.<br />Across all cultures, roughly 1% of people currently has a stuttering disorder.<br />http://westutter.org/<br />
    3. 3. HattanShobokshi<br />Senior Software Engineer<br />www.hattanshobokshi.com<br />hattan@gmail.com<br />http://speakerrate.com/hattan<br />Who am I?<br />
    4. 4. Goals for this talk<br /> Present an overview of ASP.NET MVC<br />MVC vsWebforms. Why?<br />What is the MVC paradigm?<br />Controllers and Action Methods<br />Views<br />Html Helpers<br />Models<br />Model Binding<br />Routing<br />Best Practices<br />
    5. 5. A new web development framework that allows you to develop web applications on the Microsoft stack using an MVC Architecture.<br />Is NOT a replacement for traditional ASP.NET web forms.<br />Web Forms vs MVC<br />Current Version is MVC3.<br />MVC2 and MVC3 are extension of MVC1.<br />MVC1 and MVC2 - .NET Framework 3.5 & 4.0<br />MVC3 4.0 ONLY<br />Visual Studio Tooling Support<br />Convention over configuration<br />What is ASP.NET MVC<br />
    6. 6. What is MVC?<br />
    7. 7.
    8. 8. Why should I use ASP.NET MVC? <br />Testability<br />Model Binder is awesome!<br />No Viewstate<br />SEO friendly url’s<br />Complete control over Html output<br />Easier integration with Jquery<br />Better Separation of Concerns<br />
    9. 9. ASP.NET Web Forms<br />Traditional urlhttp://www.yoursite.com/admin/menu.aspx<br />
    10. 10. ASP.NET MVC<br />http://www.yoursite.com/admin/menu<br />Admin is not a folder, but a class called AdminController<br />Menu is not a file, but a Method in the AdminController Class<br />
    11. 11. DEMO<br />
    12. 12. Routing<br />Route engine parses url’s, extracts any data and sends it off to controller<br />Create extremely customizable routes<br />Route table defines routes in global.asax<br />You do not need to define a route to handle querystring parameters. They are automatically mapped.<br />
    13. 13. Model <br />The model is the representation of your data.<br />Business Logic<br />
    14. 14. Views<br />No Code behind<br />Action methods by default call views with the same name. (Convention over configuration)<br />Views are not tied to a specific action method or controller.<br />Views should be dumb (shouldn’t contain any application logic, only rendering logic)<br />Views can be strongly typed<br />
    15. 15. Html Helpers<br />Html helpers are extension methods that generate html. @Html.TextBox(“Name”,”Bob”)<br />Html helpers are NOT controls, they simply generate html markup (strings)<br />You can create your own Html Helper.<br />
    16. 16. Model Binding<br />Takes data from an html form and creates an object.<br />No need to write plumbing code <br />
    17. 17. Best Practices<br />Never include a hard reference in the view(eg <script src=“../js/jquery.js”></script>)instead use url.content like so<script src=“<%=Url.Content(“~/js/jquery.js”)%>”></script>)<br />Never have big if then else in view, put it in an html helper<br />Add namespace to web.config so you don’t have to keep referencing it on each page<br />The difference between routing name and class name. <br />
    18. 18. Where can I get it?<br />http://www.asp.net/mvc/download/<br />http://www.microsoft.com/express/Web/<br />
    19. 19. Resources<br />http://www.asp.net/learn/mvc/<br />http://www.asp.net/learn/mvc-videos/<br />Pro ASP.NET MVC Framework by Steven Sanderson<br />Asp.net mvc Forumshttp://forums.asp.net/1146.aspx<br />http://haacked.com/<br />
    20. 20. What did we just talk about?<br /> Present an overview of ASP.NET MVC<br /> MVC vsWebforms. Why?<br />What is the MVC paradigm?<br />Controllers and Action Methods<br />Views<br />Html Helpers<br />Models<br />Model Binding<br />Routing<br />Best Practices<br />
    21. 21. The End<br />Thank you!<br />
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×