什么是updatepanel childrenastriggers属性及其使用的内容plz用一个例子来解释它 [英] what is updatepanel childrenastriggers property and for what it is used plz explain it with an example

查看:118
本文介绍了什么是updatepanel childrenastriggers属性及其使用的内容plz用一个例子来解释它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是更新面板childrenastriggers属性及其使用的内容plz用示例plzzzz解释它... thanku

解决方案

http://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel .childrenastriggers.aspx [ ^ ]

http:// www.asp.net/AJAX/Documentation/Live/mref/P_System_Web_UI_UpdatePanel_ChildrenAsTriggers.aspx [ ^ ]


设置为true时,更新面板仅从保留在其中的控件接收回发。否则,它将永远被回发。当您在同一页面上放置多个updatepanel控件时,这非常有用。


儿童为 [ ^ ]



ChildrenAsTriggers属性确定UpdatePanel结果中子控件的回发是否结果在其内容被刷新。默认情况下,此属性设置为True,仅当UpdateMode设置为conditional时才能设置为False。尝试在没有这种情况下执行此操作会导致ScriptManager在页面的PreRender事件期间抛出InvalidOperationException。



将属性设置为False允许发生异步回发,但是ScriptManager绕过与回发相关联的UpdatePanel的任何更新。



上面取自ASP.NET AJAX in Action book。我认为这比我自己的话更好



因此,如果你将此属性设置为False,那么任何按钮或链接按钮或任何导致面板内回发的控件都将导致页面正常回发(重新加载整页)



下面的文件来自文档:



您可能将ChildrenAsTriggers设置为false的情况是,当您有两个UpdatePanel控件并且希望第一个面板中的回发更新第二个面板的内容但不更新其自己的内容时。例如,第一个面板可能是要购买的产品列表,第二个面板可能是购物车。

what is update panel childrenastriggers property and for what it is used plz explain it with an example plzzzz...thanku

解决方案

http://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel.childrenastriggers.aspx[^]
http://www.asp.net/AJAX/Documentation/Live/mref/P_System_Web_UI_UpdatePanel_ChildrenAsTriggers.aspx[^]


when set to true update panel receives postback only from controls kept inside it. otherwise, it will be postedback always. this is useful when you have put multiple updatepanel controls on same page.


Children as [^]

The ChildrenAsTriggers property determines whether postbacks from a child ontrol in an UpdatePanel result in its contents being refreshed. By default, this property is set to True and can be set to False only when the UpdateMode is set to conditional. Attempting to do so without this condition results in an InvalidOperationException being thrown by the ScriptManager during the page’s PreRender event.

Setting the property to False allows asynchronous postbacks to occur, but the ScriptManager bypasses any updates to the UpdatePanel that are associated with the postback.

Above was taken from ASP.NET AJAX in Action book. I thought it would better than my own words

So if you set this property to False, then any button or link button or any control that cause postback inside the panel will cause the page to post back normally (reload entire page)

the bellow is taken from the documentation:

A scenario where you might set ChildrenAsTriggers to false is when you have two UpdatePanel controls and you want a postback from the first panel to update the content of the second panel but not update its own content. For example, the first panel might be a list of products to buy and the second panel might be a shopping cart.


这篇关于什么是updatepanel childrenastriggers属性及其使用的内容plz用一个例子来解释它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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