I'm having trouble with updating an ASP:UpdatePanel using javascript (jQuery). Here're what I have.
I'm using the hidden button trick as I seem not the be able to get the ClientID of the update panel for a __doPostBack trick).
<asp:UpdatePanel runat="server" ID="pnlUpdate">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnUpdate" />
</Triggers>
<ContentTemplate>
<asp:UpdateProgress runat="server" AssociatedUpdatePanelID="pnlUpdate" DynamicLayout="false" DisplayAfter="100">
<ProgressTemplate>
<img alt="Laddar..." src="img/loader.gif" width="16" height="11"/>
</ProgressTemplate>
</asp:UpdateProgress>
<div style="display:none;">
<asp:Button runat="server" ID="btnUpdate" CommandName="Refresh" CommandArgument='<%# Eval("Id") %>'/>
</div>
<asp:Repeater runat="server" Id="rptrEnquiry">
...
</asp:Repeater>
<%= DateTime.Now.ToString() %>
<a href="javascript:jQuery('#<%= btnUpdate.ClientID %>').trigger('click')&&undefined;">Fire!</a>
</ContentTemplate>
</asp:UpdatePanel>
In the codebehind that handles the btnUpdate (in a GridView RowCommand) the rptrEnquiry is rebound when btnUpdate is pressed.
If I press the button directly (while not hidden) everything works perfectly (updateprogess is shown and date updated and repeater updated.
But if I click the fire link and trigger the button through javascript only the date is updated but the updateprogress isn't shown and the repeater isn't rebound. While debugging I can see that the rebound code is executed but it's effect isn't in the update.