Javascript验证与C#验证. [英] Javascript Validation vs C# validation.

查看:64
本文介绍了Javascript验证与C#验证.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

我已经看到大多数使用C#验证而不是javascript的peolpe.
谁能在这方面教育我.为什么C#更受青睐或JavaScript足够多了.

问候,
AP

Dear Friends,

I have seen most of peolpe using C# validation instead of javascript.
Can any one educate me on this. Why C# is prefered more or is javascript much more enough.

Regards,
AP

推荐答案

IMHO,服务器端验证,即必须进行C#验证.但与此同时,还应使用javascript验证.

大多数临时用户都使用该网站,并且JavaScript验证对他们而言将起作用.做到这一点的好处是更快的用户响应.避免了由于回发而造成的延迟,并且用户可以立即获得反馈.

只有当某些用户正在使用启用了javascript的网站,或者有人将在执行C#中的服务器端验证时有人故意绕过javascript时.

进行javascript验证可确保网站获得更好的响应和可用性,而进行C#验证也可确保安全性.所以可以这么说.

1. Javascript验证是可选的,但C#验证不是.
2.我们应该尽量与C#一起使用javascript验证,因为这将提高可用性并减少服务器负载.
IMHO, Server side validation i.e. C# validation is a must have. But along with these the javascript validations should also be used.

most of the casual users use the web sites and for them the javascript validation will work. the benefit of having this in place is faster user response. the delay due to post-back is avoided and the user gets immediate feedback.

it is only when some user either is using the site with javascript turned of or someone is deliberately trying to bypass the javascript when server side validations in C# will be executed.

Having javascript validation is ensuring better response and usability of website where as having C# validations is ensuring security too. so we can say that.

1. Javascript validation is optional but C# validation is not.
2. We should try to use javascript validation whenever we can along with C# one as this will increase usability and decrease server load.


这篇关于Javascript验证与C#验证.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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