ASP.NET MVC From The Ground Up

4,156 views

Published on

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

  • Be the first to like this

No Downloads
Views
Total views
4,156
On SlideShare
0
From Embeds
0
Number of Embeds
189
Actions
Shares
0
Downloads
25
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • File, NewCreate basic controller, and view
  • Create another viewLink views usingHtml.ActionLink helper
  • Add PhoneNumber to AboutUs screen
  • ASP.NET MVC From The Ground Up

    1. 1. ASP.NET MVC From The Ground Up<br />Kevin Griffin<br />
    2. 2. About Me<br /><ul><li>.NET Developer
    3. 3. Chesapeake, VA
    4. 4. Microsoft Client App Dev MVP
    5. 5. Leader of the Hampton Roads .NET Users Group
    6. 6. ASPInsider
    7. 7. INETA Mentor for Virginia</li></li></ul><li>Before We Begin<br /><ul><li>Ask questions
    8. 8. Enjoy the conference, leave if you’re not getting what you expected</li></li></ul><li>* From The Ground Up<br /><ul><li>Assumptions
    9. 9. You MIGHT be a WebForms Developer
    10. 10. You know nothing about ASP.NET MVC
    11. 11. You’ve tried to sit through MVC talks before and had trouble
    12. 12. No TDD or IOC mantra today
    13. 13. Just a basic discussion of MVC</li></li></ul><li>Agenda<br /><ul><li>What is MVC?
    14. 14. Components of MVC
    15. 15. Controllers
    16. 16. Views
    17. 17. Models
    18. 18. Ditching the Blue Screen</li></li></ul><li>What Is MVC?<br /><ul><li>Model View Controller
    19. 19. ASP.NET MVC is an alternative way to build web applications on the ASP.NET platform.
    20. 20. Not a replacement to WebForms</li></li></ul><li>Let’s get it out of the way<br /><ul><li>Web Forms vs. MVC</li></li></ul><li>MVC Routes<br /><ul><li>Convention over Configuration
    21. 21. Default Route
    22. 22. http://domain/Controller/Action/ID
    23. 23. Customizable</li></li></ul><li>Controller<br /><ul><li>BRAIN of the application
    24. 24. Receives input from requests
    25. 25. Performs logic or data requests</li></li></ul><li>Model<br /><ul><li>Representationof the data required to present a view or to send data back to the server.</li></li></ul><li>View<br /><ul><li>The stuff you want to show on the screen.
    26. 26. Bind with a model to provide a data </li></li></ul><li>Demo<br />Starting From Scratch<br />
    27. 27. ActionResults<br /><ul><li>How MVC returns data
    28. 28. You specify what you want to return, and MVC handles the response.</li></li></ul><li>ActionResults<br />ViewResult – Represents HTML and markup rendered by a view.<br />ContentResult – Represents a text result.<br />EmptyResult – Represents no result.<br />FileContentResult – Represents a downloadable file (with the binary content).<br />FilePathResult – Represents a downloadable file (with a path).<br />FileStreamResult – Represents a downloadable file (with a file stream).<br />JavaScriptResult – Represents a JavaScript script.<br />JsonResult – Represents a JavaScript Object Notation result that can be used in an AJAX application.<br />PartialViewResult – Represents HTML and markup rendered by a partial view.<br />RedirectResult – Represents a redirection to a new URL.<br />RedirectToRouteResult – Represents a result that performs a redirection by using the specified route values dictionary.<br />
    29. 29. Demo<br />Adding New Views<br />
    30. 30. HTML Helpers<br /><ul><li>Extension Methods
    31. 31. Helps you render HTML content easily
    32. 32. Replacement for server controls?
    33. 33. Create your own!</li></li></ul><li>What Is A Model?<br /><ul><li>Loosely typed
    34. 34. ViewData dictionary
    35. 35. Strong typed
    36. 36. Bind to a custom object</li></li></ul><li>Demo<br />Modeling Our View<br />
    37. 37. Thanks For Attending!<br /><ul><li>Questions?!
    38. 38. kevin@kevgriffin.com
    39. 39. Twitter: @1kevgriff
    40. 40. http://www.kevgriffin.com</li>

    ×