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?
- <!--modification before-
- <system.web>
- <compilation debug="true" targetframework="4.5" />
- <httpRuntime targetframework="4.5" /> <!-Delete it-->
- </system.web>
- <!--Modified-
- <system.web>
- <compilation debug="true" targetframework="4.0" />
- </system.web>
2. Change the type of the Web. config profile setting unobtrusive Validationmode as follows:
[HTML]View Plaincopyprint?
- <!--modification before-
- <system.web>
- <compilation debug="true" targetframework="4.5" />
- <httpRuntime targetframework="4.5" />
- </system.web>
- <!--Modified-
- <system.web>
- <compilation debug="true" targetframework="4.5" />
- <httpRuntime targetframework="4.5" />
- </system.web>
- <appSettings>
- <add key= "validationsettings:unobtrusivevalidationmode" value="None" />
- </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