验证控件ASP.NET服务器端或客户端? [英] Validation Controls for ASP.NET Server side or client side?

查看:135
本文介绍了验证控件ASP.NET服务器端或客户端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否验证控件在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检查。当。。。的时候
  用户提交一个页面到服务器,验证控件调用
  检查通过控制用户的输入,控制。验证后发生
  页面初始化(即,后视图状态和回传的数据有
  被处理),但任何改变之前,或者单击事件处理程序
  调用。

Validation controls perform input checking in server code. When the user submits a page to the server, the validation controls are invoked to check the user input, control by control. Validation occurs after page initialization (that is, after view state and postback data have been processed) but before any change or click event handlers are called.

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服务器端或客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆