Book Image

Microsoft .NET Framework 4.5 Quickstart Cookbook

By : Jose Luis Latorre
Book Image

Microsoft .NET Framework 4.5 Quickstart Cookbook

By: Jose Luis Latorre

Overview of this book

With about ten years since its first release, Microsoft's .NET Framework 4.5 is one of the most solid development technologies to create casual, business, or enterprise applications. It has evolved into a very stable framework and solid framework for developing applications, with a solid core, called the CLR (Common Language Runtime) Microsoft .NET Framework 4.5 includes massive changes and enables modern application and UI development."Microsoft .Net Framework 4.5 Quickstart Cookbook" aims to give you a run through the most exciting features of the latest version. You will experience all the flavors of .NET 4.5 hands on. The “How-to” recipes mix the right ingredients for a final taste of the most appetizing features and characteristics. The book is written in a way that enables you to dip in and out of the chapters.The book is full of practical code examples that are designed to clearly exemplify the different features and their applications in real-world development. All the chapters and recipes are progressive and based on the fresh features on .NET Framework 4.5.The book will begin by teaching you to build a modern UI application and improve it to make it Windows 8 Modern UI apps lifecycle model-compliant. You will create a portable library and throttle data source updating delays. Towards the end of the book, you will create you first Web API.
Table of Contents (19 chapters)
Microsoft .NET Framework 4.5 Quickstart Cookbook
Credits
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Preface
Index

Configuring our application to use unobtrusive validation


This new feature will allow us to configure our validator controls for the use of unobtrusive client validation logic in a very simple way. A very significant benefit of doing this is the reduction of the amount of JavaScript rendered in the page, making it substantially smaller.

Note that unobtrusive means not obtrusive or undesirably noticeable, which is generally a good practice for JavaScript, meaning that there is a separation of responsibility between the web page (presentation) and its behavior.

Getting ready

In order to use this recipe you should have Visual Studio 2012. We will use this as well as the application generated from our previous recipe.

How to do it...

Here we will create a sample app and see how to apply unobtrusive validation to it and how it affects the resulting HTML.

  1. Open our previous ASP.NET application or create a new one.

  2. Open the Web.Config file.

  3. Locate the <appSettings> element.

  4. If it doesn't exist, add...