最好使用AJAX或JQuery或更新面板 [英] Which is best to use AJAX or JQuery or Update Panel

查看:86
本文介绍了最好使用AJAX或JQuery或更新面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪种方法最适合在大型应用中使用以获得最佳性能?

-具有多个更新面板和视图状态压缩的部分回发?

-使用JQuery和JavaScript代替服务器端postabcks吗?

-使用纯AJAX与通过Ajax调用Web服务并在Web服务中设置逻辑

或任何其他组合方式??

请详细指导我..

提前感谢

Which is best to use in large application to get best peformance ?

--Partial post-back with multiple Update Panels and View-State Compression ?

-- Use JQuery and JavaScript instead of server side postabcks ?

-- Use Pure AJAX with calling webservices using ajax and set logic in webservice

or any other combine way ??

Please guide me in detail ..

Thanx in advance

推荐答案

它们每个都有自己的优点(有时是缺点).

1)具有多个更新面板和视图状态压缩的部分回发.

Update-Panels -对于服务器控件,可以将Update-Panels用于Ajax实现,但是应避免使用过多的嵌套式Update-Panel.

视图状态压缩-这将有助于提高网页的性能,但同时也存在浏览器兼容性问题.

2)使用JQuery和JavaScript代替服务器端的postabcks.

您可以使用JQuery实现AJAX.并且使用JQuery和JavaScript的客户端对功能的处理可以改善用户体验.但是这里应该避免使用敏感的业务逻辑,因为用户可以在浏览器中禁用JavaScript,这是一个安全问题.

3)将纯AJAX与使用Ajax调用Web服务一起使用,并在Web服务中设置逻辑.

纯AJAX" -如果您指的是XMLHttpRequest的使用,那么您不需要进行所有这些传统的工作.正如我在Point-2中提到的那样,您可以使用JQuery轻松实现AJAX.您可以参考有关此主题的提示/技巧.

简化Asp.Net Core Ajax

Web服务-如果您的多个应用程序要使用该实现,则使用Web/WCF服务更有意义.否则,使用Classs/Class-Library的简单Business-Layer应该没问题.
Each of them has their own advantages(and sometimes disadvantages).

1) Partial post-back with multiple Update Panels and View-State Compression.

Update-Panels - For Server-Controls you can use Update-Panels for Ajax implementation, But use of excessive and Nested Update-Panels should be avoided.

View-State Compression - This will help to improve performance of a Web-Page but it also has Browser-Compatibility issues.

2) Use JQuery and JavaScript instead of server side postabcks.

You can implement AJAX using JQuery. And Client side handling of the functionalities using JQuery and JavaScript may improve User-Experience. But sensitive business logic should be avoided here becuase JavaScript can be disabled in browser by users which is a security issue.

3) Use Pure AJAX with calling webservices using ajax and set logic in webservice.

"Pure AJAX" - If you are referring to use of XMLHttpRequest, then you do not require to take all those traditional efforts. As I mentioned in Point-2, you can easily implement AJAX by using JQuery. You may refer to my Tip/Trick on this topic.

Simplifying Asp.Net Core Ajax

Web Service - Use of Web/WCF Service makes more sense if your multiple applications are going to use that implementation. Otherwise simple Business-Layer using Classes/Class-Library should be Ok.


这篇关于最好使用AJAX或JQuery或更新面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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