ASP.Net 2012不显眼的验证与jQuery [英] ASP.Net 2012 Unobtrusive Validation with jQuery

查看:160
本文介绍了ASP.Net 2012不显眼的验证与jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是用Visual Studio 2012中玩,我创建了一个空ASP.Net Web应用程序后,当我试图给的传统的验证程序控件的添加到新的页面,在此发生错误:


  

的WebForms UnobtrusiveValidationMode需要'jQuery的'一ScriptResourceMapping。请添加一个名为ScriptResourceMapping的jQuery(区分大小写)。


什么是解决它的步骤是什么?

这是我的网页标记:

< ASP:面板=服务器ID =pnlUsernameGroupingText =用户名设置>
    < D​​IV>
        < ASP:标签ID =usernameLabel文本=请输入您的用户名=服务器AssociatedControlID =用户名/>
    < / DIV>
    < D​​IV>
        < ASP:文本框=服务器ID =用户名/>
        < ASP:的RequiredFieldValidator的ErrorMessage =用户名要求的ControlToValidate =用户名=服务器文本= - 要求/>
    < / DIV>
< / ASP:面板>


解决方案

好像有很多关于ValidationSettings不正确的信息:UnobtrusiveValidationMode值。要停用它,你需要做到以下几点。

 <添加键=ValidationSettings:UnobtrusiveValidationModeVALUE =无/>

字无,不WebForms的应该用于禁用此功能。

I was playing with Visual Studio 2012 and I created an empty ASP.Net Web Application, when I tried to add the traditional validator controls to a new page, this error occurs:

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

What are the steps to fix it?

This is my page markup:

<asp:Panel runat="server" ID="pnlUsername" GroupingText="Username settings">
    <div>
        <asp:Label ID="usernameLabel" Text="Please enter your username" runat="server" AssociatedControlID="username" />
    </div>
    <div>
        <asp:TextBox runat="server" ID="username" />
        <asp:RequiredFieldValidator ErrorMessage="The username is required" ControlToValidate="username" runat="server" Text=" - Required" />
    </div>
</asp:Panel>

解决方案

It seems like there is a lot of incorrect information about the ValidationSettings:UnobtrusiveValidationMode value. To Disable it you need to do the following.

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

The word None, not WebForms should be used to disable this feature.

这篇关于ASP.Net 2012不显眼的验证与jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆