哪些验证是增加应用程序性能javascript或asp验证控件? [英] which validations are increase application performance javascript or asp validation controls?

查看:77
本文介绍了哪些验证是增加应用程序性能javascript或asp验证控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑,我是否需要在我的asp网络应用程序中使用java脚本或asp验证

请建议我哪个更好,更有效?并且会减轻申请的负担?

解决方案

两者都有自己的优点和缺点。但我(我的意见)建议你不要依赖 javascript 验证本身。它可以在浏览器中轻松禁用,并可能导致插入重复记录。



没有多少两种验证的性能差异



参考此处:

了解ASP.NET验证技术 [ ^ ]



请从以下链接中查看一些好的答案:

http://stackoverflow.com/questions/7809275/javascript -validation-overwrit es-asp-net-validators [ ^ ]

http://stackoverflow.com/questions/19534323/advantages-of-asp-net-validation-controls-over-javascript [ ^ ]

http://stackoverflow.com/questions/2869930/javascript-vs-asp-net-validation-哪一个选择 [ ^ ]


要选择的验证类型取决于t他正在为您构建应用程序的场景。您必须就性能安全性进行协商。如果安全性是主要问题,那么你应该坚持服务器端验证。



我个人建议服务器端验证如果绕过客户端验证,那么你的服务器端验证来拯救您免受服务器端处理的任何潜在损害。最近,我们已经听过很多关于SQL注入的故事和其他可能应用的技术,以获得一些邪恶的好处。



相反,客户端脚本验证可以优化和增强性能客户端验证可以减少服务器端的往返次数,从而大大减少每个用户的请求数量。 / blockquote>

你好raxhemanth,



正如Jas24所说,依赖于javascript验证它是不安全的

但是你问的是性能所以javascript会给你更多的性能。

例如,如果你在客户端实现字符串名称验证并且你成功了,那就不够了(这还不够)

现在尝试实现这样的服务器端验证以获得更安全的验证

  private   bool  isValidName( string  name)
{
bool retBool = false ;
if (!string.IsNullOrEmpty(name)) // 您可以添加自己的条件
{
retBool = true ;
}
return retBool;
}



这也确保了服务器端,以便不会将无效数据插入到数据库中。

所以它总是安全的实现客户端和服务器端验证。



希望这对你有所帮助。



问候,

RK


i am getting confused whether i need to use java script or asp validations in my asp web app
please suggest me which is better and efficient? and will reduce burden on the application?

解决方案

Both has its own advantages as well as disadvantages.But i(my opinion) suggest you not to depend on javascript validation itself.It can easily be disabled in browsers and it may leads to insert duplicate records.

There are not much difference in performance for both validation(s)

Refer here:
Understanding ASP.NET Validation Techniques[^]

Please see some good answers from these links:
http://stackoverflow.com/questions/7809275/javascript-validation-overwrites-asp-net-validators[^]
http://stackoverflow.com/questions/19534323/advantages-of-asp-net-validation-controls-over-javascript[^]
http://stackoverflow.com/questions/2869930/javascript-vs-asp-net-validation-which-one-to-choose[^]


The type of Validation to be chosen depends upon the scenario for which you are building your application. You have to either negotiate in terms of security of performance. If security is a primary concern than you shall stick to Server side validation.

I personally recommend Server side validations If client-side validation is bypassed, your server-side validations come to rescue you from any potential damage to your server-side processing. In recent times, we have already heard lot of stories of SQL Injections and other sort of techniques that might be applied in order to gain some evil benefits.

On contrary client script validations optimize and enhance performance Client-side validation reduce the server-side round-trips so that the number of requests per user are considerably reduced.


Hi raxhemanth,

As Jas24 said, its not safe to depend on javascript validation
But you are asking about performance so javascript gives you more performance.
For instance if you implementing string name validation in client side and you succeed on it,(thats not enough)
now try to implement server side validation like this to get safer validation

private bool isValidName(string name)
        {
            bool retBool = false;
            if (!string.IsNullOrEmpty(name)) //You can add your own condition
            {
                retBool =  true;
            }
            return retBool;
        }


Which ensures in server side also, so that no invalid data will be inserted into DB.
So its always safe to implement Client side and Server side validation.

Hope this helps you a bit.

Regards,
RK


这篇关于哪些验证是增加应用程序性能javascript或asp验证控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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