I believe there have been ASP. NET learner must be familiar with the RequiredFieldValidator control (to verify non-empty controls). The function of this control is to prohibit the input of specified content (that is, the value of the attribute InitialValue, the default value of this attribute is an empty string, which is often used to verify whether the content entered by the user is null .). In addition, spaces at both ends of the input content are automatically removed before verification.
Today, I encountered the following problems when practicing this control:
Error cause
In the development of Visual Studio 2012 (or 2013) WebForm 4.5, many controls Enable Unobtrusive ValidationMode by default (the so-called Unobtrusive Validation is an implicit verification method) but it is not assigned a value. Programmer must manually set it. For example, various validator controls used for data verification (RequiredFieldValidator control used today) and authorization and authenication settings need to be performed by calling jquery on the front end for authentication, both Enable the Unobtrusive ValidationMode by default. If this attribute is not configured, an ERROR occurs.
Solution
From the cause of the error, we can easily remedy the problem. From the cause of the error, we can solve the problem in three ways:
1. Reduce the. Framework version as permitted by the program as follows:
<! -- Before modification --> <system. web> <compilation debug = "true" targetFramework = "4.5"/>
2. Change the Unobtrusive ValidationMode type in the Web. config configuration file. The specific method is as follows:
<! -- Before modification --> <system. web> <compilation debug = "true" targetFramework = "4.5"/>
3. Find the corresponding Jquery (aspnet. scriptmanager. jquery. dl) file and copy it to the bin folder.
Jquery is not added because I am a new empty Web application. You can create a non-empty Web application to paste the corresponding Jquery file to the folder mentioned above.
The above three methods tend to be the third method. The first and second methods give people a sense of escaping from the problem. The third method is the way to solve the problem when the problem is discovered (personal understanding ). At the same time, I have also read a lot of blogs in the process of solving this problem. Everyone has provided similar methods more or less, but there are few reasons to describe the problem. This may be part of the reason why Chinese software pages are subject to humans.
(If you have any questions about cainiao, I hope you will not give me any advice)
Help link: http://www.shaoqun.com/a/56680.aspx
Reprinted please indicate the source: http://blog.csdn.net/senior_lee