Enabling Unobtrusive Ajax

The process for enabling unobtrusive Ajax is similar to the one for unobtrusive client validation that I showed you in the previous chapter. To enable the feature, we set the value for UnobtrusiveJavaScriptEnabled to true in Web.config, as shown in Listing 30-4.

Listing 30-4. Enabling the unobtrusive JavaScript support in Web.config

<configuration>   <appSettings>     <add key="ClientValidationEnabled" value="true"/>     <add key="UnobtrusiveJavaScriptEnabled" value="true"/>   </appSettings> ...

In addition to setting the configuration option, we must also make sure that the required JavaScript libraries are referenced from the views in which we want to use Ajax. The simplest way to do this is to place the script ...

Get Applied ASP.NET 4 in Context now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.