1 / 19

CS 415 N-Tier Application Development

National University of Computer and Emerging Sciences . Lecture # 6 Microsoft MVC4 Architecture for ASP.NET. CS 415 N-Tier Application Development . By Umair Ashraf June 29 ,2013. Agenda/Contents for Today’s Lecture. Class Activity Solution MVC3 Framework Review

nubia
Download Presentation

CS 415 N-Tier Application Development

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. National University of Computer and Emerging Sciences Lecture # 6 MicrosoftMVC4 Architecture for ASP.NET CS 415 N-Tier Application Development By Umair Ashraf June 29 ,2013

  2. Agenda/Contents for Today’s Lecture • Class Activity Solution • MVC3 Framework Review • Creating Model • Concept of Scaffolding • Practical Demonstration • Quiz # 1

  3. Components of ASP.NET MVC3/MVC4 • Models These are the classes that represent the domain you are interested in. With ASP.NET MVC, this is most likely a Data Access Layer of some kind using a tool like Entity Framework or NHibernate combined with custom code containing domain-specific logic • View This is a template to dynamically generate HTML • Controller This is a special class that manages the relationship between the View and Model.

  4. Model • The word model in software development is overloaded to cover hundreds of different concepts. • You have maturity models, design models, threat models, and process models. It’s rare to sit through a development meeting without talking about a model of one type or another. • Even when you scope the term “model” to the context of the MVC design pattern, you can still debate the merits of having a business-oriented model object versus a view-specific model object

  5. Crafting Model class • public class Album • { • public virtual intAlbumId { get; set; } • public virtual intGenreId { get; set; } • public virtual intArtistId { get; set; } • public virtual string Title { get; set; } • public virtual decimal Price { get; set; } • public virtual string AlbumArtUrl { get; set; } • public virtual Genre Genre { get; set; } • public virtual Artist Artist { get; set; } • }

  6. What Is Scaffolding? • Scaffolding in ASP.NET MVC can generate the boilerplate code you need for create, read, update, anddelete (CRUD) functionality in an application. The scaffolding templates can examine the type definition for a model (such as the Album class you’ve created), and then generate a controller and the controller’s associated views. The scaffolding knows how to name controllers, how to name views, what code needs to go in each component, and also knows where to place all these pieces in the project for the application to work.

  7. MVC 4 Overview • ASP.NET Web API • Enhancements to default project templates • Mobile project template using equerry Mobile • Display Modes • Task support for Asynchronous Controllers • Bundling and minification

  8. Project Template Using jQuery Mobile

  9. Creating an ASP.NET MVC 4 Application

  10. Creating an ASP.NET MVC 4 Application

  11. MVC APPLICATION STRUCTURE

  12. MVC4 Project Structure

  13. A Simple Example: The Home Controller

  14. A Simple Example Output

  15. Creating the New Controller

  16. STRONGLY TYPED VIEWS

  17. Add View Dialog Options

  18. View Scaffold Types

  19. Reference Material Text Book :Professional ASP.NET MVC4 By WROX (EBook uploaded on website ) Other References : http://www.w3schools.com/aspnet/mvc_intro.asp http://www.asp.net/mvc/tutorials

More Related