jQuery的AJAX的UpdatePanel对比 [英] jQuery AJAX vs. UpdatePanel

查看:121
本文介绍了jQuery的AJAX的UpdatePanel对比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经有了一个页面一吨,我们要减磅B / C是维护恶梦的jQuery(约2000线),它可能更容易在服务器上维护。我们已经想过使用的UpdatePanel这一点。但是,我们不喜欢的事实,UpdatePanel的发送整个页面回服务器。

We've got a page with a ton of jQuery (approximately 2000 lines) that we want to trim down b/c it is a maintenance nightmare, and it might be easier to maintain on the server. We've thought about using UpdatePanel for this. However, we don't like the fact that the UpdatePanel is sending the whole page back to the server.

推荐答案

不要动到UpdatePanel的。从jQuery的未来后,性能下降将是站不住脚的。尤其是页面上的复杂和你的声音。

Don't move to UpdatePanels. After coming from jQuery, the drop in performance would be untenable. Especially on a page as complex as yours sounds.

如果你有2000行JavaScript code的,解决的办法是重构了code。如果你把2000行C#code在一个文件中,这将是难以维持了。这将是困难的是任何语言或工具有效管理。

If you have 2,000 lines of JavaScript code, the solution is to refactor that code. If you put 2,000 lines of C# code in one file, it would be difficult to maintain too. That would be difficult to manage effectively with any language or tool.

如果你使用3.5 SP1,则可以使用ScriptManager的新脚本结合到你的JavaScript分成没有惩罚多个文件。这样一来,就可以进行逻辑分区的code,就像你会与服务器端的code。

If you're using 3.5 SP1, you can use the ScriptManager's new script combining to separate your JavaScript into multiple files with no penalty. That way, you can logically partition your code just as you would with server side code.

这篇关于jQuery的AJAX的UpdatePanel对比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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