asp.net - ASP.NET 服务器端或客户端的验证控件?

标签 asp.net validation controls

ASP.NET 中的验证控件在服务器端和客户端都有效吗?还是仅用于客户端验证?

谢谢

最佳答案

ASP.NET 验证控件同时执行 client sideserver side验证。 EnableClientValidationdisable 的属性(property)客户端验证。

引自 ASP.NET Validation Controls 的 MSDN 文档

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 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.

You can invoke validation in your own code by calling a validation control's Validate method

关于asp.net - ASP.NET 服务器端或客户端的验证控件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24596891/

相关文章:

c# - 对于包含 ASP.NET 项目的 .NET 框架解决方案,迁移到 "new project system"(PackageReference) 是否安全/可行?

ASP.Net 页面未回发 - 而是重新加载

jquery - jQuery 中的 Ajax 与 ASP.NET - 返回字符串

asp.net - IIS 7.5 中的 Windows 身份验证因信任关系异常而失败

python - django modelform验证从数据库获取字段如果不是如果表单

kubernetes - 为什么我们需要 OPA 网守?

c# - Treeview 控件 - ContextSwitchDeadlock 解决方法

asp.net-mvc - 客户端验证随机不起作用

c# - 如何根据 Entity Framework 中的上下文验证实体?

c# - 将控件插入 Tab 键顺序的最佳方法?