问题描述
是否验证控件在ASP.NET工作在服务器端和客户端?或者它仅仅是为了客户端验证?
Does the validation controls in ASP.NET works in server side as well as client side? or it is for client side validation only?
感谢
推荐答案
ASP.NET验证控件同时执行客户端
和服务器端
验证。 EnableClientValidation
是属性禁用
客户端验证。
ASP.NET validation control perform both client side
and server side
validation. EnableClientValidation
is the property to disable
client side validation.
从MSDN文档所报 ASP.NET验证控件
验证控件执行输入服务器code检查。当。。。的时候
用户提交一个页面到服务器,验证控件调用
检查通过控制用户的输入,控制。验证后发生
页面初始化(即,后视图状态和回传的数据有
被处理),但任何改变之前,或者单击事件处理程序
调用。
ASP.NET服务器即使验证上执行验证
控制已经执行它在客户端上,让你可以测试
为基于服务器的事件处理程序中的有效性。
ASP.NET performs validation on the server even if the validation controls have already performed it on the client, so that you can test for validity within your server-based event handlers.
您可以通过调用验证调用在自己的code验证
控件的Validate方法
You can invoke validation in your own code by calling a validation control's Validate method
这篇关于验证控件ASP.NET服务器端或客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!