Introduction to Mvc

235 views

Published on

Internal MVC training

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

  • Be the first to like this

No Downloads
Views
Total views
235
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction to Mvc

  1. 1. Part 1 4/9/2014Infobest Romania
  2. 2.  MVC Architecture  M, V and C  Separation of Concerns  .NET MVC Framework  Demo 4/9/2014Infobest Romania  Create a project.How is it configured by default?  Model, View Controller  Razor  Routing  Friendly URLs  Test driven dev  Bundling  Minification  Validation  Forms  Send data to controller from view  Form security
  3. 3. 4/9/2014Infobest Romania
  4. 4. Players  Controller: - Handles a request from a View and updates the Model that results in a change of the Model's state. - Sends Data to View  Model: The business entity on which the overall application operates. Many applications use a persistent storage mechanism (such as a database) to store data. MVC does not specifically mention the data access layer because it is understood to be encapsulated by the Model.  View: The user interface that renders the Model into a form of interaction. 4/9/2014Infobest Romania
  5. 5. To implement MVC in .NET we need mainly three classes (View, Controller and the Model). 4/9/2014Infobest Romania
  6. 6.  The process of breaking a computer program into distinct features that overlap in functionality as little as possible  MVC design pattern aims to separate content from presentation and data-processing from content. Theoretically sound, but where do we see this in MVC? One place is reasonably clear - between the data-processing (Model) and the rest of the application. 4/9/2014Infobest Romania
  7. 7. 4/9/2014Infobest Romania
  8. 8.  Thus our models, controllers and views lie in logical/physical layers independent of each other. 4/9/2014Infobest Romania
  9. 9. 4/9/2014Infobest Romania
  10. 10. 4/9/2014Infobest Romania
  11. 11.  Create a project.How is it configured by default?  Model, View Controller  Razor  Routing  Friendly URLs  Test driven dev  Bundling  Minification  Validation  Forms  Send data to controller from view  Form security 4/9/2014Infobest Romania
  12. 12. 4/9/2014Infobest Romania
  13. 13. 4/9/2014Infobest Romania
  14. 14. 4/9/2014Infobest Romania
  15. 15. 4/9/2014Infobest Romania
  16. 16. 4/9/2014Infobest Romania
  17. 17. 4/9/2014Infobest Romania
  18. 18. 4/9/2014Infobest Romania
  19. 19.  ”In addition, the facility exists to optimise (minify) the CSS and Script files for release builds, whilst at the same time providing normal scripts for debugging the web application.” http://johnnewcombe.net/blog/post/4 4/9/2014Infobest Romania
  20. 20. 4/9/2014Infobest Romania
  21. 21. 4/9/2014Infobest Romania
  22. 22. 4/9/2014Infobest Romania
  23. 23.  BundleTable.EnableOptimizations = true; 4/9/2014Infobest Romania
  24. 24.  Resources  http://www.asp.net/mvc/tutorials/mvc- 4/bundling-and-minification  https://www.youtube.com/watch?v=y4ceKd- JSqc 4/9/2014Infobest Romania
  25. 25. 4/9/2014Infobest Romania
  26. 26.  @using (Html.BeginForm("Index", "Test"))  {  …  <input type=“submit” id=“submitIndexView”/>  } 4/9/2014Infobest Romania
  27. 27.  @using (Html.BeginForm("Index", “Test“ ,new {argTest = "someText"}))  {  …  <input type=“submit” id=“submitIndexView”/>  } 4/9/2014Infobest Romania
  28. 28. For View  @Html.AntiForgeryToken() For Controller  [HttpPost]  [ValidateAntiForgeryToken] 4/9/2014Infobest Romania
  29. 29. Claudiu Socaci 4/9/2014Infobest Romania

×