At first glance, it should be easy to inject a javascript, but it took a little bit of digging around to figure out the resolution, the key is to use ScriptManager.
<asp:UpdatePanel ID="myUpdatePanel" UpdateMode="Conditional" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnClick" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:ImageButton ID="btnClick" ImageUrl="ClickMe.png" runat="server"
CausesValidation="false" OnClick="btnClickEvent" ToolTip="Click Me"
AlternateText="Click me!" />
</ContentTemplate>
</asp:UpdatePanel>
We wanted to dynamically inject some JavaScript code. If my ScriptManager control has EnablePartialRendering set to true, it's a simple matter of registering the script. What i didn't realize earlier was that you don't need to the use the current page or current event, you need to call the static method on the ScriptManager class. More...