The problem is: When performing data verification on some textbox input boxes, the server data verification control is initially used. This is no problem. Later, some other textbox also needs to do some data verification. In this case, the server verification control is not used, but an onclientclick script is added to the button to verify the function judgeinput (). <Asp: button id = "btnsave" skinid = "buttonstyle" runat = "server" text = "save" onclick = "btnsave_click" onclientclick = "Return judgeinput (); "/>.
At this point, the problem is exposed. The data verification function in judgeinput () is normal, and all the previously used server data verification controls are invalid. It seems that I am not familiar with the internal mechanism of the server data verification control.
Solution:Add if (page_clientvalidate () {.../data verification at the beginning of the judgeinput () functionCode}.Solve the problem.
Summary: verify the data of the server data verification control. It is executed on the client. After the verification is passed, page_clientvalidate () returns true; otherwise, it is false. when onclientclick is not available, it is executed by default, but with the client function onclientclick, if page_clientvalidate () is not displayed, data verification of the server data verification control is not executed by default.