-
Book Overview & Buying
-
Table Of Contents
Microsoft .NET Framework 4.5 Quickstart Cookbook
By :
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.
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.
Here we will create a sample app and see how to apply unobtrusive validation to it and how it affects the resulting HTML.
Open our previous ASP.NET application or create a new one.
Open the Web.Config file.
Locate the <appSettings> element.
If it doesn't exist, add...
Change the font size
Change margin width
Change background colour