服务器端/客户端或两个用户输入验证 [英] Server Side/Client Side or Both User Input Validation

查看:106
本文介绍了服务器端/客户端或两个用户输入验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是使用验证您的网站时,我想给人客户端的帮手的验证,如密码不够长的最佳方式,电子邮件是不正确的格式,但也做服务器端验证并返回错误,如用户名已经存在,并且具有客户端和服务器验证消息目测显示相同的与复制的最小量的用户。

What is the best way to use validation on your site when I want to give people client side "helper" validation such as password not long enough, email is incorrect format but also do server side validation and return errors such as username already exists and have both client and server validation messages visually be displayed the same to the user with the minimal amount of duplication.

推荐答案

客户端验证可以很容易规避。您应始终验证服务器的敏感数据,而不管客户端验证。验证他们的客户也只是一个改进的用户体验问题。

Client validation can be circumvented easily. You should always validate sensitive data on server, regardless of client validation. Validating them on client too is just a matter of improved user experience.

BTW,ASP.NET验证控件两者都做。

BTW, ASP.NET validation controls do both.

这篇关于服务器端/客户端或两个用户输入验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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