VS2013 validation control appears WebForms Unobtrusivevalidationmode requires "jquery" Scriptresour ... Solution for errors

Source: Internet
Author: User

The error is as follows:

The solution is as follows:

Method One:

Found in Webconfig

<appSettings>

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

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

</appSettings>

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

If there are no above two sentences: add in appsettings byte

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

Such a sentence will be OK.

Method Two:

1. Create a new scripts folder at the root of the website, add jquery-1.7.2.min.js and jquery-1.7.2.js to it (you can use a different version depending on your needs).

2. Add the Global Application class Global.asax file under the root directory and add the following code to the Application_Start event:

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 verify, so you can set not to use Unobtrusivevalidationmode, as below, set in Page_Load,

protectedvoid Page_Load (object sender, EventArgs e)

{

Unobtrusivevalidationmode =unobtrusivevalidationmode.none;

}

BS because of the different languages different platforms caused by the compatibility problem is much more serious than CS, due to the development of the language itself part of the control's name use has also undergone great changes, these places need our special attention.

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.