MVC

This Wrox Blox is for .NET developers who already have experience developing web applications with ASP.NET MVC and want to learn the new features introduced in the new release of ASP.NET MVC. ASP.NET MVC 2 has been built with the goal to increase productivity and make ASP.NET MVC ready for enterprise development. This Wrox Blox guides the reader through the new features by explaining how to use data scaffolding and automatic validation, how to write custom validators, how to create multi-area projects, and how and when to use async controllers. It also covers the new automatic HTML Encoding feature introduced in ASP.NET 4 and how it helps increasing the security of ASP.NET MVC web applications. In addition, it provides examples built both with Visual Studio 2010 and with the still supported Visual Studio 2008.

Table of Contents

Introducing ASP.NET MVC 2 1
Runs on Visual Studio 2008 and Visual Studio 2010 2

Templated Helpers and Model Metadata 2
HiddenInputAttribute 5
How to Write Custom Templates 7
Validation 8
Client-Side Validation 10
Custom Validation Rules 10

Areas 15

Asynchronous Controllers 18
Why Asynchronous Operations Matter 18
The Anatomy of an Asynchronous Controller 18
How to Implement an Async Controller 19
When to Use an Async Controller 21

RenderAction and Child Actions 22

Strongly Typed UI Helpers 24

Enhancements to ModelBinders 25
Default Value 25
Increasing Security with HTTPS 26
Avoiding the JSON Array Attack 26
Short Notation for AcceptVerbs Attribute 27
Overriding the HTTP Verb 27
Binary Binding 28

Automatic HTML-Encoding 29

Enhanced Visual Studio Tooling 30

Summary 31

About Simone Chiaretta 32

Book Details

* Paperback: 35 pages
* Publisher: Wrox (May, 2010)
* Language: English
* ISBN-13: 978-0470767481

* File Size: 9.4 MiB

Image

Over 70 clear and incredibly effective recipes to get the most out of the many tools and features of the ASP.NET MVC framework

  • Solutions to the most common problems encountered with ASP.NET MVC development
  • Build and maintain large applications with ease using ASP.NET MVC
  • Recipes to enhance the look, feel, and user experience of your web applications
  • Expand your MVC toolbox with an introduction to lots of open source tools
  • Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible

In Detail

ASP.NET MVC, one of the latest web development platforms from Microsoft, brings the power of MVC programming to ASP.NET development. It simplifies the task of application development and maintenance for developers. However, ASP.NET MVC is filled with so many features that developers end up looking for solutions to the many problems that are encountered in their routine development tasks.ASP.NET MVC 2 Cookbook will provide solutions for the very specific problems that are encountered while developing applications with the ASP.NET MVC platform. It consists of many recipes containing step-by-step instructions that guide developers to effectively use the wide array of tools and features of ASP.NET MVC platform for web development

ASP.NET MVC Cookbook is a collection of recipes that will help you to perform your routine development tasks with ease using the ASP.NET MVC platform. In this book you will be walked through the solution to several specific web application development problems. Each recipe will walk you through the creation of a web application, setting up any Visual Studio project requirements, adding in any external tools, and finally the programming steps needed to solve the problem. The focus of the book is to describe the solution from start to finish.

The book starts off with recipes that demonstrate how to work effectively with views and controllers - two of the most important ingredients of the ASP.NET MVC framework. It then gradually moves on to cover many advanced routing techniques. Considering the importance of having a consistent structure to the site, the book contains recipes to show how to build a consistent UI and control its look with master pages. It also contains a chapter that is packed with many recipes that demonstrate how to gain control of data within a view.

As the book progresses through some exciting recipes on performing complex tasks with forms, you will discover how easy it is to work with forms to jazz up the look of your web site. Building large applications with ease is one of the prime features of the MVC model. Therefore, this book also focuses on tools and features that make building large applications easier to manage. As data plays an important role in the MVC architecture, there are ample recipes dedicated to cover data validation, access, and storage techniques. Finally, the book demonstrates how to enhance the user experience of your visitors by controlling the data at the application, session, caching, and cookie level.

By the end of this book, you will have explored a wide array of tools and features available with the ASP.NET MVC platform

A fast-paced cookbook with recipes covering all that you wanted to know about developing with ASP.NET MVC

What you will learn from this book

  • Get to grips with views and build view content from the data passed
  • Work with actions and controllers to perform some important tasks such as creating a CAPTCHA system and generating a PDF order summary
  • Get a handle on complex routing issues such as using wild card parameters to support slug URLs
  • Create and use master pages to control application wide formatting
  • Handle the creation of master-detail pages with AJAX modal pop-ups
  • Use templated helpers, model binding, and areas to build large-scale applications with ease
  • Perform various validations to ensure that the data entered is correct
  • Access and store data with the different techniques available in ASP.NET MVC application development
  • Manage the data at the application, site, caching, and cookie level
  • Keep track of the number of visitors and maintain their information while they are at your site

Approach

Written in cookbook style, this book offers solutions to all common web development problems through recipes. Each recipe contains step-by-step instructions followed by the analysis of what was done in each task and other useful information. The book is designed so that you can read it chapter by chapter, or you can look at the list of recipes and refer to them in no particular order.

Who this book is written for

This book is particularly written for web developers looking to transfer their knowledge from the ASP.NET Web Forms way of doing things to the ASP.NET MVC framework. As this book targets readers of various experience levels, you should be able to find recipes of a basic, intermediate, and advanced nature. Regardless of your experience level, each recipe will walk you through the solution in a step by step manner that anyone should be able to follow.

Image

Over 70 clear and incredibly effective recipes to get the most out of the many tools and features of the ASP.NET MVC framework

  • Solutions to the most common problems encountered with ASP.NET MVC development
  • Build and maintain large applications with ease using ASP.NET MVC
  • Recipes to enhance the look, feel, and user experience of your web applications
  • Expand your MVC toolbox with an introduction to lots of open source tools
  • Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible

In Detail

ASP.NET MVC, one of the latest web development platforms from Microsoft, brings the power of MVC programming to ASP.NET development. It simplifies the task of application development and maintenance for developers. However, ASP.NET MVC is filled with so many features that developers end up looking for solutions to the many problems that are encountered in their routine development tasks.ASP.NET MVC 2 Cookbook will provide solutions for the very specific problems that are encountered while developing applications with the ASP.NET MVC platform. It consists of many recipes containing step-by-step instructions that guide developers to effectively use the wide array of tools and features of ASP.NET MVC platform for web development

ASP.NET MVC Cookbook is a collection of recipes that will help you to perform your routine development tasks with ease using the ASP.NET MVC platform. In this book you will be walked through the solution to several specific web application development problems. Each recipe will walk you through the creation of a web application, setting up any Visual Studio project requirements, adding in any external tools, and finally the programming steps needed to solve the problem. The focus of the book is to describe the solution from start to finish.

The book starts off with recipes that demonstrate how to work effectively with views and controllers - two of the most important ingredients of the ASP.NET MVC framework. It then gradually moves on to cover many advanced routing techniques. Considering the importance of having a consistent structure to the site, the book contains recipes to show how to build a consistent UI and control its look with master pages. It also contains a chapter that is packed with many recipes that demonstrate how to gain control of data within a view.

As the book progresses through some exciting recipes on performing complex tasks with forms, you will discover how easy it is to work with forms to jazz up the look of your web site. Building large applications with ease is one of the prime features of the MVC model. Therefore, this book also focuses on tools and features that make building large applications easier to manage. As data plays an important role in the MVC architecture, there are ample recipes dedicated to cover data validation, access, and storage techniques. Finally, the book demonstrates how to enhance the user experience of your visitors by controlling the data at the application, session, caching, and cookie level.

By the end of this book, you will have explored a wide array of tools and features available with the ASP.NET MVC platform

A fast-paced cookbook with recipes covering all that you wanted to know about developing with ASP.NET MVC

What you will learn from this book

  • Get to grips with views and build view content from the data passed
  • Work with actions and controllers to perform some important tasks such as creating a CAPTCHA system and generating a PDF order summary
  • Get a handle on complex routing issues such as using wild card parameters to support slug URLs
  • Create and use master pages to control application wide formatting
  • Handle the creation of master-detail pages with AJAX modal pop-ups
  • Use templated helpers, model binding, and areas to build large-scale applications with ease
  • Perform various validations to ensure that the data entered is correct
  • Access and store data with the different techniques available in ASP.NET MVC application development
  • Manage the data at the application, site, caching, and cookie level
  • Keep track of the number of visitors and maintain their information while they are at your site

Approach

Written in cookbook style, this book offers solutions to all common web development problems through recipes. Each recipe contains step-by-step instructions followed by the analysis of what was done in each task and other useful information. The book is designed so that you can read it chapter by chapter, or you can look at the list of recipes and refer to them in no particular order.

Who this book is written for

This book is particularly written for web developers looking to transfer their knowledge from the ASP.NET Web Forms way of doing things to the ASP.NET MVC framework. As this book targets readers of various experience levels, you should be able to find recipes of a basic, intermediate, and advanced nature. Regardless of your experience level, each recipe will walk you through the solution in a step by step manner that anyone should be able to follow.

This Wrox Blox is for .NET developers who already have experience developing web applications with ASP.NET MVC and want to learn the new features introduced in the new release of ASP.NET MVC. ASP.NET MVC 2 has been built with the goal to increase productivity and make ASP.NET MVC ready for enterprise development. This Wrox Blox guides the reader through the new features by explaining how to use data scaffolding and automatic validation, how to write custom validators, how to create multi-area projects, and how and when to use async controllers. It also covers the new automatic HTML Encoding feature introduced in ASP.NET 4 and how it helps increasing the security of ASP.NET MVC web applications. In addition, it provides examples built both with Visual Studio 2010 and with the still supported Visual Studio 2008.

Table of Contents

Introducing ASP.NET MVC 2 1
Runs on Visual Studio 2008 and Visual Studio 2010 2

Templated Helpers and Model Metadata 2
HiddenInputAttribute 5
How to Write Custom Templates 7
Validation 8
Client-Side Validation 10
Custom Validation Rules 10

Areas 15

Asynchronous Controllers 18
Why Asynchronous Operations Matter 18
The Anatomy of an Asynchronous Controller 18
How to Implement an Async Controller 19
When to Use an Async Controller 21

RenderAction and Child Actions 22

Strongly Typed UI Helpers 24

Enhancements to ModelBinders 25
Default Value 25
Increasing Security with HTTPS 26
Avoiding the JSON Array Attack 26
Short Notation for AcceptVerbs Attribute 27
Overriding the HTTP Verb 27
Binary Binding 28

Automatic HTML-Encoding 29

Enhanced Visual Studio Tooling 30

Summary 31

About Simone Chiaretta 32

Book Details

* Paperback: 35 pages
* Publisher: Wrox (May, 2010)
* Language: English
* ISBN-13: 978-0470767481

* File Size: 9.4 MiB

Image

Expert Spring MVC and Web Flows shows you how to use the Spring web application development framework, part of the Spring Framework. This book covers Spring's Model-View-Controller (MVC) code packages, HTTP, best practices for web application development, and integration with popular third-party utilities. Also featured is the new Spring Web Flow system, a cutting-edge workflow system introduced in Spring 1.3. The Web Flow system provides the perfect complement to the existing MVC system, rounding out Spring's robust and powerful web development framework.

This book is a must-read for anyone desiring to bridge the gap between the most popular web framework and the most popular application framework. The book pays special attention to existing Apache Struts–based web applications. It explains different options for integrating Struts code to take advantage of the powerful Spring Framework. Authors Seth Ladd and Keith Donald develop a sample application over the course of the book and build on the application as a method for introducing new material. Further, they provide a porting guide detailing how to port a Struts application into Spring MVC.

Image

Build scalable and extendable web applications using the agile MVC framework

  • Increase reusability and empower the delivery of more complex design patterns by extending the MVC concept
  • Build an editable web interface
  • Extend Catalyst through plugins
  • Plenty of examples with detailed walkthroughs to create sample applications
  • Updated for the latest version, Catalyst 5.8

In Detail

Many web applications are implemented in a way that makes developing them difficult and repetitive. Catalyst is an open source Perl-based Model-View-Controller framework that aims to solve this problem by reorganizing your web application to design and implement it in a natural, maintainable, and testable manner, making web development fun, fast, and rewarding.

This book teaches you how to use Catalyst to weave the various components involved in a web application, using methods and tools you personally prefer along with recommendations and details on the most popularly used objects like the DBIX ORM, TT2 Template, and Moose.

This book will take you from how the MVC pattern simplifies creating quality applications to how Catalyst allows you to tap this power instantly. It explains advanced design patterns and concludes with the improvements that Moose brings to all this. It also incorporates valuable suggestions and feedback received from the community members and our customers. By the end of the book, you will be able to build clean, scalable, and extendable web applications. This book embodies Catalyst's philosophies of Do It Yourself and Don't Repeat Yourself.

Design, develop, test, and deploy applications rapidly with the open source MVC Catalyst frameworkWhat you will learn from this book

  • Use the Template toolkit to generate HTML output
  • Design a database schema and access a SQLite database
  • Create a CRUD interface to a database
  • Use FormBuilder to define auto-generating and self-validating forms
  • Create easy-to-maintain configuration files
  • Import CSV files into a database
  • Paginate search results
  • Use the session plugin to add sessions to an application
  • Explore authentication and authorization, implementing page-level and record-level control
  • Use DBIC for easy handling of data
  • Add a REST API to allow other applications to access your application
  • Add AJAX interactivity to your application
  • Incorporate RSS feeds in your application
  • Automate testing and learn "Test-Driven Development"
  • Mix a procedural interface with a relational DBIx::Class interface
  • Write a database interface without DBIx::Class
  • Build a custom Model without using any database

Approach

The book is written in an exploratory style: try something and then understand how it works. It will guide you through the features of Catalyst using real-world examples and systematic code snippets.

Who this book is written for

If you are a Perl Developer and want to strengthen your skill by understanding Web Application development using MVC principles, then this book is for you.

Image

Delve into the features, principles, and pillars of the ASP.NET MVC framework-deftly guided by Web development luminary Dino Esposito. ASP.NET MVC forces developers to think in terms of distinct components-model, view, controller-that make it easier to manage application complexity. Plunge into the framework's internal mechanics and gain a practical, what-why-how perspective behind each ASP.NET MVC building block. You'll understand how and when to use this programming model as an alternative to Web Forms-to gain full control of HTML, simplify testing and extensibility, and design better Web sites and experiences. As always, Esposito provides the detailed, insightful guidance and illustrative code samples you need to get productive quickly.

Image

In this book, world-renowned ASP.NET expert and member of the Microsoft ASP.NET team Stephen Walther shows experienced developers how to use Microsoft’s new ASP.NET MVC Framework to build web applications that are more powerful, flexible, testable, manageable, scalable, and extensible.

 

Writing for professional programmers, Walther explains the crucial concepts that make the Model-View-Controller (MVC) development paradigm work so well and shows exactly how to apply them with the ASP.NET MVC Framework. From controllers and actions to views and models, Walther demonstrates how to apply each ASP.NET MVC Framework feature in real-world projects.

 

In Part II, you’ll walk step-by-step through building a full-fledged ASP.NET MVC blog application that implements capabilities ranging from data access to validation. Through this case study, you’ll learn how to build ASP.NET MVC applications using test-driven development processes that enable rapid feedback, greater productivity, and better quality.

 

Throughout, Walther presents extensive code examples, reflecting his unsurpassed experience as an ASP.NET instructor, a leading commercial developer, and now as a member of Microsoft’s ASP.NET development team.

 

Understand how to:

  • Build enterprise-scale web applications far more rapidly and effectively
  • Develop web applications that are easier to maintain and extend over time
  • Gain unprecedented control over the appearance of your website or application
  • Expose intuitive URLs that are friendlier to search engines and users alike
  • Create ASP.NET MVC models that contain all your application’s business, validation, and data access logic
  • Make the most of HTML helpers, model binders, action filters, routing, and authentication
  • Efficiently deploy your ASP.NET MVC applications
  • Use the lightweight JQuery JavaScript library to easily find and manipulate HTML elements
  • Create ASP.NET MVC applications using unit test and mock object framework
Image

Design, develop, and test powerful and robust web applications with MVC framework the agile way

  • Rapid guide to building powerful web applications with ASP.NET MVC framework
  • Covers all facets of web application development including requirement analysis, design, building, testing, and deployment
  • Explore the ASP.NET MVC framework with several newly released features including WebForms, Script Combining, jQuery integration, and ASP.Net MVC AJAX helpers
  • Rich with example code, clear explanations, and interesting examples - a truly hands-on book for ASP.NET developers

In Detail

Using WebForms has led to problems for ASP.NET developers, such as low testability and inconsistent code. These problems become increasingly relevant when trying to develop or maintain anything but the simplest web site.

This book takes you through the ASP.NET MVC framework to help you simplify and build web applications quickly. With example applications built on best practices and with clear explanations, you will get started in no time.

The MVC pattern is widely accepted as one of the best approaches for building modern web applications and Microsoft's new ASP.NET MVC Framework offers a fully supported way for developers to implement MVC in ASP.NET.

This book takes you through the essential tasks to create powerful web applications as fast as possible. These essential tasks are explained clearly, with well-structured instructions. The book does not cover every single feature in detail; it provides precise information for you to get started, and takes you through the creation of an example application that covers MVC application design techniques.

In addition to helping you write code, this book covers unit testing, to improve the stability and quality of the application you are building. It provides a quick reference to the MOQ framework to aid in unit testing. With this book, you will soon have the skills that will make you an ASP.NET developer to be reckoned with, and you will be creating applications with a speed that will astonish your colleagues and boss!

What you will learn from this book?

  • Learn about the architecture of ASP.NET MVC framework
  • Integrate AJAX and ASP.NET MVC and use ASP.NET AJAX and jQuery to build powerful database-driven web applications
  • Customize the ASP.NET MVC request lifecycle
  • Give your application clean URLs and a direct coupling between URL and application logic
  • Create mock objects to improve the design of code within Test-Driven deployment
  • Get familiar with unit testing in a web application, including advanced unit testing concepts such as mocking

Approach

The book walks through the main concepts of the MVC framework to help ASP.NET developers to move on to a higher level. It includes clear instructions and lots of code examples. It takes a simple approach, thereby allowing you to work with all facets of web application development: requirements, designing, testing, and deployment.

Who this book is written for?

This book is for ASP.NET developers who want a fast-paced guide to building powerful web applications using the ASP.NET MVC framework. All the code examples are in C#.

Subscribe to RSS - MVC