VS2013 validation control appears WebForms Unobtrusivevalidationmode must "jquery" Scriptresour ... The wrong solution

Source: Internet
Author: User

such as the following error:

Solutions such as the following:

Method One:

Found in Webconfig

<appSettings>

<addkey= "Aspnet:usetaskfriendlysynchronizationcontext" value= "true"/>

<addkey= "Validationsettings:unobtrusivevalidationmode" value= "WebForms"/>

</appSettings>

Delete <addkey= "Validationsettings:unobtrusivevalidationmode" value= "WebForms"/> is ok.

Assuming there are no above two sentences: Add in appsettings bytes

<addkey= "Validationsettings:unobtrusivevalidationmode" value= "None"/>

Such a sentence will be OK.

Method Two:

1. Create a new Scripts folder under the site root folder, add Jquery-1.7.2.min.js and Jquery-1.7.2.js to the inside (depending on the version number you need to use),

2. Add the Global Application class Global.asax file under the root folder, and add the following code to the Application_Start event, for example:

ScriptManager.ScriptResourceMapping.AddDefinition ("jquery", New scriptresourcedefinition

{

Path = "~/scripts/jquery-1.7.2.min.js",

Debugpath= "~/scripts/jquery-1.7.2.js",

Cdnpath = " Http://ajax.microsoft.com/ajax/jQuery/jquery-1.7.2.min.js ",

cdndebugpath= " Http://ajax.microsoft.com/ajax/jQuery/jquery-1.7.2.js "

});

Method Three:

That is because WebForm uses Unobtrusivevalidationmode to authenticate, so it is possible to set not to use Unobtrusivevalidationmode. For example, the following, set in Page_Load,

protectedvoid Page_Load (object sender, EventArgs e)

{

Unobtrusivevalidationmode =unobtrusivevalidationmode.none;

}

BS because the compatibility problems caused by different platforms in different languages are much more serious than CS, because the development of the language itself has undergone a very large change in the name of the control, and we need to pay particular attention to these areas.

Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.

VS2013 validation control appears WebForms Unobtrusivevalidationmode must "jquery" Scriptresour ... The wrong solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.