优点和使用Ajax更新面板在ASP.NET应用程序的优缺点 [英] Advantages and disadvantages of using Ajax update panels in ASP.NET application

查看:146
本文介绍了优点和使用Ajax更新面板在ASP.NET应用程序的优缺点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有哪些优点和使用Ajax更新面板在ASP.NET应用程序的缺点。是否有可避免使用Ajax更新面板的其它方法吗?

What are the advantages and disadvantages of using Ajax update panels in ASP.NET application. Is there any alternatives available to avoid the use of Ajax update panel?

推荐答案

优势:

  1. 易于使用和配置(好吧,我不知道有任何其他的优点!)

缺点:

请参阅这里和的here
现在的最好的部分,在方案:

See here and here
Now for the best part, the alternatives:

使用jQuery的内置对Ajax使得到支撑/ POST Ajax调用,这是非常简单的(不是更新面板,我会说简单),并与大多数浏览器绝对兼容!
使用许多简单的方法,jQuery提供做阿贾克斯的一个范例电话:

Use jQuery's built in support for Ajax to make GET/POST Ajax calls, it's very simple (simpler than the update panel I would say), and absolutely compatible with most browsers!
An example of using one of the many easy ways jQuery provides for doing Ajax calls:

  $('#anotherContainer').load('/Home/RegularAjaxResource');

这只会调用(在这种情况下RegularAjaxResource)的服务器资源,并显示它的ID为anotherContainer

This would simply call a server resource (RegularAjaxResource in this case) and display it's returned data on an UI element with id anotherContainer

这篇关于优点和使用Ajax更新面板在ASP.NET应用程序的优缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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