Why UnobtrusiveJavaScriptEnabled = true ¿deshabilitar mi ajax para que funcione?
Estaba haciendo una muestra usando la maquinilla de afeitar MVC3, y escribí esto:
<p>
Show me the time in:
@Ajax.ActionLink("UTC", "GetTime", new { zone = "utc" }, new AjaxOptions { UpdateTargetId = "myResults" })
@Ajax.ActionLink("BST", "GetTime", new { zone = "bst" }, new AjaxOptions { UpdateTargetId = "myResults" })
@Ajax.ActionLink("MDT", "GetTime", new { zone = "mdt" }, new AjaxOptions { UpdateTargetId = "myResults" })
</p>
<div id="myResults" style="border: 2px dotted red; padding: .5em;">
Results will appear here
</div>
<p>
This page was generated at @DateTime.UtcNow.ToString("h:MM:ss tt") (UTC)
</p>
Todas mis llamadas ajax no funcionaron hasta que cambié esta clave en web.config:
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
De lo que leí en este artículo:http: //weblogs.asp.net/owscott/archive/2010/11/17/mvc-3-ajax-redirecting-instead-of-updating-div.asp
Pero ahora toda mi validación de cliente no funciona como antes.
Mi pregunta e: ¿cómo hacer que el código ajax funcione y las validaciones del lado del cliente al mismo tiempo? ¿Y cuál es esta propiedad sobre "UnobtrusiveJavaScriptEnabled"? ¿Es un cambio entre ellos? Espero entender más sobre esto en palabras simples.