AsyncPostBackTrigger和PostBackTrigger上的UpdatePanel之间的区别? [英] Difference between AsyncPostBackTrigger and PostBackTrigger on UpdatePanel?

查看:418
本文介绍了AsyncPostBackTrigger和PostBackTrigger上的UpdatePanel之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 GridView控件(ucLAD)在我的的UpdatePanel (upnlListing)。里面我 ucLAD 我有一个复选框,并为行动 rowClicked

I have a GridView(ucLAD) in my UpdatePanel(upnlListing). Inside my ucLAD I have a checkbox and an action for rowClicked:

<asp:UpdatePanel ID="upnlListing" runat="server" >
     <Triggers>
        <asp:AsyncPostBackTrigger ControlID="ucLAD"/>
        <%-- <asp:PostBackTrigger ControlID="ucLAD"/> --%>
     </Triggers>
     <ContentTemplate>
        <asp:Panel ID="pnlRequest" runat="server" style="margin-top:15px; height: auto;">
             <ucgv:BaseGrid runat="server" ID="ucLAD"/>
        </asp:Panel>

     </ContentTemplate>  
</asp:UpdatePanel>

当我使用 PostBackTrigger 执行的是当我检查复选框 rowClicked 同样的事情发生了行动,但当我使用 AsyncPostBackTrigger ,我可以检查复选框但是当我点击该行,为 rowClicked D在行动 Ť触发。我该如何解决这个问题?

When I use the PostBackTrigger the action performed would be the rowClicked same thing happen when I check the checkbox but when I use the AsyncPostBackTrigger, I can check the checkboxes but when I click the row, the action for rowClicked don't trigger. How can I fix this?

推荐答案

作为描述上的SO质疑

As describe in on of the SO question

<一个href=\"http://stackoverflow.com/questions/4912614/what-is-the-different-between-asyncpostbacktrigger-postbacktrigger-really\">What是AsyncPostBackTrigger与放大器之间的不同; PostBackTrigger真的吗?

一个UpdatePanel控件内部默认导致部分页面更新,控件外造成回传,使用这些触发它有可能改变这种行为的要求。

Controls inside an UpdatePanel by default cause a partial page update, controls outside cause a postback, using these triggers it is possible to change this behaviour as required.

从的http://seminaarit.$c$czone.fi/video/devdays-2007/track1/2/2-ASP-dotNET_AJAX_Extensions.ppt

转换成回发异步回调
通常用于触发更新时,一个UpdatePanel控件外回传
如果ChildrenAsTriggers,可用于指定控件的UpdatePanel里面应该回调,而不是回发=FALSE

Converts postbacks into async callbacks Typically used to trigger updates when controls outside an UpdatePanel post back If ChildrenAsTriggers="false", can be used to specify which controls inside UpdatePanel should call back rather than post back

让里面的UpdatePanel控件后回
通常用于使某些控件后回来时,ChildrenAsTriggers =真

Lets controls inside UpdatePanel post back Typically used to allow certain controls to post back when ChildrenAsTriggers="true

这篇关于AsyncPostBackTrigger和PostBackTrigger上的UpdatePanel之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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