JQTransform Not Working After Partial Update ASP.NET Ajax

I have the following update panel that works...

After I press the button (partial page update) the page loses the JQTransform images.

The update panel works fine and the current datetime is displayed correctly.

How do I make the images stay?


//Header Files

<script src="jquery-1.5.1.min.js" type="text/javascript"></script>

    <link href="jqtransform.css" rel="stylesheet" type="text/css" />

    <script src="jquery.jqtransform.js" type="text/javascript"></script>


// code behind

protected void Page_Load(object sender, EventArgs e)
{

    string script = "$(function () { $('form').jqTransform() });";

    ScriptManager.RegisterStartupScript(Page, GetType(), "jqTransform", script, true);

        }

protected void btnTest_Click(object sender, EventArgs e)
{
            lblTest.Text = DateTime.Now.ToString();
}


// aspx page
<asp:UpdatePanel ID="updTest" runat="server" UpdateMode="Conditional">

<ContentTemplate>
    <div class="rowElem">
    <asp:Button ID="btnTest" runat="server" Text="submit" onclick="btnTest_Click" />
    </div>
    <asp:Label ID="lblTest" runat="server" />
    
</ContentTemplate>

<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnTest" EventName="Click" />
</Triggers>

</asp:UpdatePanel>

Open in new window

ButtonImages.png
DarrenshomeAsked:
Who is Participating?
 
DarrenshomeAuthor Commented:
Add this code to your page header and the update will work as expected!
<script type="text/JavaScript">

$(document).ready(function(){
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    
      prm.add_endRequest(function() {

           $('.rowElem').jqTransform();
    });
});



</script>

Open in new window

0
 
DarrenshomeAuthor Commented:
This was the solution to my problem and it works a treat!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.