Visual Studio 2013 New ASP. NET project using the empty template, a solution that uses validation control errors in the page

Source: Internet
Author: User

Visual Studio 2013 New ASP. NET project using the empty template, using validation controls on the page, running the page, the following error occurs:

Cause of error

VisualStudio 2012 (or) WebForm 4.5 development, many controls by default enable the unobtrusive Validationmode (so-called unobtrusive Validation, is a property of implicit authentication (related to the reference to jquery), but it is not assigned a value, programmer must be set manually. For example, the various validator used for data validation (the RequiredFieldValidator control used today), and the authorization and authenication settings, Because jquery is required to be called on the front-end for authentication, unobtrusive Validationmode is the default enable. If this property is not configured, an error is generated.

Workaround

From the cause of the error we can easily remedy the situation, from the wrong reasons we have to solve the problem of the method is nothing but three:

1, in the case of allowing the program to reduce. The version of the framework, in the following ways:

[HTML]View Plaincopyprint?
  1. <!--modification before-
  2. <system.web>
  3. <compilation debug="true" targetframework="4.5" />
  4. <httpRuntime targetframework="4.5" /> <!-Delete it-->
  5. </system.web>
  6. <!--Modified-
  7. <system.web>
  8. <compilation debug="true" targetframework="4.0" />
  9. </system.web>


2. Change the type of the Web. config profile setting unobtrusive Validationmode as follows:

[HTML]View Plaincopyprint?
  1. <!--modification before-
  2. <system.web>
  3. <compilation debug="true" targetframework="4.5" />
  4. <httpRuntime targetframework="4.5" />
  5. </system.web>
  6. <!--Modified-
  7. <system.web>
  8. <compilation debug="true" targetframework="4.5" />
  9. <httpRuntime targetframework="4.5" />
  10. </system.web>
  11. <appSettings>
  12. <add key= "validationsettings:unobtrusivevalidationmode" value="None" />
  13. </appSettings>

3. Locate the appropriate AspNet.ScriptManager.jQuery.dll file and copy it to the Bin folder.

Since I am a new empty Web application, I did not add jquery. We can paste the corresponding jquery file into the folder mentioned above by creating a new non-empty Web application.

For convenience, you can click to download AspNet.ScriptManager.jQuery.dll.

This article refers to the following: Http://blog.csdn.net/senior_lee/article/details/35337081?utm_source=tuicool

Visual Studio 2013 New ASP. NET project using the empty template, a solution that uses validation control errors in the page

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.