UpdatePanel Triggers

The update panel was changed since the last beta and CTP versions.  Before it didn't contain some of the postback triggers that were available.  So I experimented with the new features, and it's pretty cool how the final version works.  For instance, if you have a control outside of the update panel:

<asp:DropDownList id="ddlMake" runat="server" AutoPostBack="true" .. />

You can refresh the second list whenever an item in the first list changes by "hooking" up to the first drop down through an AsyncPostBackTrigger, as such:

<asp:UpdatePanel id="upModel" runat="server" Mode="Conditional">
  <ContentTemplate>
    <asp:DropDownList id="ddlModel" runat="server" />
  </ContentTemplate>
  <Triggers>
    <asp:AsyncPostBackTrigger ControlID="ddlMake" />
  </Triggers>
</asp:UpdatePanel>

You can also hook up to a specific event through EventName as well.  Now, what if you have a control in an update panel, that you don't want to work with the asynchronous updates?  I actually had this happen.  This is where the <asp:PostBackTrigger> comes in, because it can register a control that will post back, allowing you to work in the opposite direction, if so desired.

Published Wednesday, April 04, 2007 1:15 AM by bmains
Filed under: ,

Comments

No Comments

The leading UI suite for ASP.NET - Telerik radControls
Outstanding performance. Full ASP.NET AJAX support. Nearly codeless development.