When using ASP.NET 4.5 and you have some ASP validation controls on the page together with a postback control from the RadControls for ASP.NET AJAX suite, the following exception will be thrown:
WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).
This can be reproduced with the following simple markup:
According to Microsoft, unobtrusive validation is the new way ASP.NET net validators work and it by default requires jQuery. We ship jQuery with our controls, but we did not register it the way Microsoft wants before Q3 2012 SP1. Proper resource mapping was added in the Q3 Service Pack 1 release. In the meantime the following steps will allow you to use this feature:
1. Add Global.asax file to the project
2. Put the following code in the Application_Start event:
NOTE: There is currently a bug in the default ASP ScriptManager that requires jQuery to be the first script registered on the page in order for Unobtrusive Validation to work: http://connect.microsoft.com/VisualStudio/feedback/details/748064/unobtrusive-validation-breaks-with-a-script-manager-on-the-page.
WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).
This can be reproduced with the following simple markup:
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"ScriptManager1"
>
</
telerik:RadScriptManager
>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"ComboBox1"
></
telerik:RadComboBox
>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Submit"
/>
<
asp:RequiredFieldValidator
runat
=
"server"
ID
=
"RequiredFieldValidator1"
ErrorMessage
=
"Choose a destination first"
ControlToValidate
=
"ComboBox1"
/>
According to Microsoft, unobtrusive validation is the new way ASP.NET net validators work and it by default requires jQuery. We ship jQuery with our controls, but we did not register it the way Microsoft wants before Q3 2012 SP1. Proper resource mapping was added in the Q3 Service Pack 1 release. In the meantime the following steps will allow you to use this feature:
1. Add Global.asax file to the project
2. Put the following code in the Application_Start event:
var def =
new
ScriptResourceDefinition()
{
ResourceName =
"Telerik.Web.UI.Common.jQuery.js"
,
ResourceAssembly = System.Reflection.Assembly.GetAssembly(
typeof
(Telerik.Web.UI.RadWebControl))
};
ScriptManager.ScriptResourceMapping.AddDefinition(
"jquery"
, def);
NOTE: There is currently a bug in the default ASP ScriptManager that requires jQuery to be the first script registered on the page in order for Unobtrusive Validation to work: http://connect.microsoft.com/VisualStudio/feedback/details/748064/unobtrusive-validation-breaks-with-a-script-manager-on-the-page.