ebook img

ASP.NET MVC 4 Mobile App Development PDF

445 Pages·2013·8.55 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview ASP.NET MVC 4 Mobile App Development

Table of Contents ASP.NET MVC 4 Mobile App Development Credits About the Author Acknowledgment About the Reviewers www.PacktPub.com Support files, eBooks, discount offers and more Why Subscribe? Free Access for Packt account holders Instant Updates on New Packt Books Preface What this book covers What you need for this book Who this book is for Conventions Reader feedback Customer support Downloading the example code Errata Piracy Questions 1. Developing for the Mobile Web History of the mobile web The Nokia 9000 Market fragmentation WAP 1.0 and WML WAP 2.0 and XHTML MP Continued development constraints Processing constraints Network constraints Content compression Server to client compression Minification Image optimizations Lower color depth CSS image sprites Data URIs Content Delivery Networks Cached data Less traffic Presentation constraints Single window Lower resolution Content spacing Viewing the mobile web Market percentage Browser variants and compatibility WebKit Trident Gecko Presto Emulating the mobile web Mobile device and browser emulators Opera Android iOS Windows Mobile The user agent Emulating Internet Explorer Mobile Emulating Mobile Safari Emulating Chrome for Mobile Emulation in this book Support for the mobile web in ASP.NET MVC 4 Summary 2. Homebrew and You Understanding the homebrew domain Knowing your ingredients Malt Yeast Ale versus lager Hops Brewing Mashing Sparging The boil Fermentation Bottling and kegging About our mobile app App requirements Adding, editing, and deleting recipes Adding recipes to a library Rating recipes Commenting on recipes Anonymous browsing, authenticated contributing The BrewHow solution Creating the project Choosing our template The Empty template The Basic template The Internet Application template The Intranet Application template The Mobile Application template The Web API template Project changes in MVC 4 NuGet Global.asax Launching the BrewHow app Responsive design Configuring and launching an emulator Summary 3. Introducing ASP.NET MVC 4 The Model-View-Controller pattern The controller The view The model The MVC pattern and ASP.NET MVC 4 Controllers in ASP.NET MVC Creating the Recipe controller Introduction to routing Action methods ActionResults Invoking the Recipe controller Views in ASP.NET MVC Razor The @ character Code blocks Expressions Inline code Comments Shared views Layouts The _ViewStart file Partial views HTML helpers Html.RenderPartial and Html.Partial Html.RenderAction and Html.Action Display templates Html.Display Html.DisplayFor Html.DisplayForModel Editor templates Creating our Recipe view Making Recipe default Returning a model to the view Using ViewData Using ViewBag Using TempData Strongly typed models Returning a Recipe list Creating the model Returning the model Displaying the model Summary 4. Modeling BrewHow in EF5 What's new in Entity Framework 5.0? Performance enhancements LocalDB support Enumeration support The BrewHow model Modeling data Recipe Review Style Category The BrewHow context Generating our database Altering the model Adding relationships Overriding conventions Enabling migrations The InitialCreate migration The Configuration class Adding seed data Adding a migration Applying migrations Consuming the model Pagination Summary 5. The BrewHow Domain and Domain-driven Design Tenets of DDD Domain model Entities Value objects Aggregates Factories Repositories Services BrewHow design BrewHow entities BrewHow repositories Consuming the domain Recipe view model Data annotations Recipe controller GET versus POST Model binding Recipe views Summary 6. Writing Maintainable Code The SOLID principles Single Responsibility Principle Open Closed Principle Liskov Substitution Principle Interface Segregation Principle Dependency Inversion Principle SOLIDifying BrewHow Adding interfaces Infrastructure Dependency Injection Service locator Managed Extensibility Framework Convention-based configuration MEF Service Locator Using the MEF Service Locator Dependency Resolver The MefDependencyResolver class Completing the conversion IBrewHowContext Repositories Registering dependencies Summary 7. Separating Functionality Using Routes and Areas Routes Locating by style Routing constraints Style interaction Recipe list modification Style Controller and view Slugging BrewHow Model slugs Stage the database Modifying entities Retrieval by slug Areas Creating the review area Registering the Review area The Recipe review controller Recipe review view models Recipe review action methods Creating the views Area route values Routing namespaces Summary 8. Validating User Input Data validation Data annotations MetadataType attribute Updating the database Validating the validations Server validation Cross-Site Request Forgery (CSRF) ValidateAntiForgeryToken Cross-Site Scripting (XSS) ValidateInput attribute AllowHtml Html.Raw Summary 9. Identifying and Authorizing Users User authentication Windows authentication Forms authentication Authenticating BrewHow users SimpleMembership Customizing authentication SimpleMembership initialization Unifying contexts The UserProfile repository AccountController contexts Registering and logging in External authentication Registering with an external account Associating an external account Authorization Restricting access The Authorize attribute Authorizing user contributions Cleaning the UI Content ownership Enabling ownership UserProfile schema mapping Seeding users Applying the ownership migration Assigning ownership Enforcing ownership Adjusting the view model Ensuring ownership Validating ownership A recipe library The library data model The library repository The library controller The library view Summary 10. Asynchronous Programming and Bundles Asynchronous programming Task Parallel Library Task Creating a Task Awaiting completion Completion callbacks Async Await Asynchronous controller action methods Creating asynchronous actions An asynchronous recipe controller Bundles Creating bundles Bundle types Wildcard support Consuming bundles Summary 11. Coding for the Real-time Web Simulating a connected state Long polling Forever Frame Server-Sent Events WebSockets SignalR Persistent connections Hubs Real-time recipe updates Installing and configuring SignalR Creating the recipe hub Modifying the recipe list view Publishing event notifications Summary 12. Designing Your App for Mobile Devices HTML5 Markup changes The DOCTYPE tag The character set Type attributes Visual Studio 2012 support Semantic tags The article tag The header tag The section tag The nav tag The footer tag Modifying recipe details Custom data attributes Form controls Local storage Geolocation CSS3 Media types CSS selectors Type selectors ID selectors Attribute selectors Class selectors Universal selectors Pseudo-class selectors CSS media queries Media features The viewport meta tag A responsive design

Description:
Create next-generation applications for smart phones, tablets, and mobile devices using the ASP.NET MVC development framework Overview Learn and utilize the latest Microsoft tools and technologies to develop mobile web apps with a native feel Create web applications for the traditional and mobile we
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.