WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).

时间:2022-07-07 09:04:51

新开一个Web site。没有使用jQuery,当Insus.NET使用一些验证控件时,如RequiredfieldValidator,程序出现下面错误:

WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).

怎么回来,使用NuGet来安装jQuery并在网页引用jQury类库,只要一运行,此错误依然出现。

在网上搜索一回,然后出错的不此Insus.NET一个人,还有很多。解决此方法,就是配置web.Config文档,在appSettings添加一个Key:
WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).

<add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>