I have a User Control, named MyUpdateControl, that fires a startup script - its HTML is simply:
<div id="updatableArea"></div>
The startup script is added in the User Control's OnLoad():
string doUpdateScript = String.Format(
"DoUpdate('{0}')",
someValue);
this.Parent.Page.ClientScript.RegisterStartupScript(typeof(Page), "DoUpdateScript", doUpdateScript);
The MyUpdateControl User Control is sometimes contained within an Update Panel in another User Control:
<asp:UpdatePanel ID="myUpdatePanel" runat="server" >
<ContentTemplate>
<UC1:MyUpdateControl ID="myUpdaterControl" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
In those cases, the script is only fired when the page first loads. It never fires during an asynchronous postback. How can I ensure that it's also called during asynchronous postbacks?