一个更新面板与多个更新面板 [英] One Update Panel vs. Multiple Update Panels

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

问题描述

我有一个ASP.NET网页显示的各种需要在一定条件下,点击按钮等进行更新的最佳领域。我们已经实现AJAX,使用ASP.NET更新面板,以避免可见的回传。

I have an ASP.NET web page that displays a variety of fields that need to be updated best on certain conditions, button clicks and so on. We've implemented AJAX, using the ASP.NET Update Panel to avoid visible postbacks.

本来也仅有的有一个的,需要这种能力方面......这很快扩大到其他领域。现在我的网页有多个UpdatePanel的。

Originally there was only one area that needed this ability ... that soon expanded to other fields. Now my web page has multiple UpdatePanels.

我想知道是否这将是最好的只是包装在一个单一的UpdatePanel整个表格,或保持独立的UpdatePanel。

I am wondering if it would be best to just wrap the entire form in a single UpdatePanel, or keep the individual UpdatePanels.

什么是使用ASP.NET的UpdatePanel的最佳实践?

What are the best practices for using the ASP.NET UpdatePanel?

推荐答案

多个面板要好得多。其中一个主要的原因为在所有使用的UpdatePanel是减小流量,并只发送需要来回穿过导线的碎片。通过只使用一个更新面板,你是pretty多少做了充分的回发每一次,你仅仅使用一些JavaScript不闪烁,以更新页面。

Multiple panels are much better. One of the main reasons for using UpdatePanels at all is to reduce the traffic and to only send the pieces that you need back and forth across the wire. By only using one update panel, you're pretty much doing a full post back every time, you're just using a little Javascript to update the page without a flicker.

如果有需要一起更新,有很多方法可以引发其它面板,当一个不进行更新。但你一定要使用多个更新面板。页面片

If there are pieces of the page that need to be updated together, there are ways to trigger other panels to update when one does.. but you should definitely be using multiple update panels.

这篇关于一个更新面板与多个更新面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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