Q:

jquery effect highlight not working in asp.net update panel

i have two update panels as follows (when linkbutton is clicked i'm trying to highlight div)
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>     
              <asp:Linkbutton id="btnChange" runat="server" OnCommand="LinkButton_Command"/>
              <asp:Linkbutton id="btnChange2" runat="server" OnCommand="LinkButton_Command"/>
        </ContentTemplate>        
</asp:UpdatePanel> 

<asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>    
             <div id="shdr">Hello there!</div> 
        </ContentTemplate>        
</asp:UpdatePanel>

I'm overriding OnLoadComplete and registering this script on page as follows
ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "divHigh", "$('#shdr').effect('highlight', {}, 3000);", True)

This highlights the div after postback but the timeout value doesn't work it continues to show highlighted color and doesn't change back.
What can be causing this not to work?

A:

If you're using an UpdatePanel - i.e. a Script Manager
$(function () {
 //Code that runs before update panel is fired.

        //Listen for update panel
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        //Re-initialize jquery after an auto post back.
        function EndRequestHandler(sender, args) {
            //Do work after update panel fires.
        } 
    });

So essentially you will have your jQuery code and then the same code inside the EndRequestHandler function if you want it to be able to run after a post back.

