gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 00:25:22 25 4
gpt4 key购买 nike

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com