jQuery methods and UpdatePanel

Last post 12-03-2007 7:30 PM by gt1329a. 1 replies.

Sort Posts:

  • jQuery methods and UpdatePanel

    12-03-2007, 6:02 PM
    • Loading...
    • rdelgadoj
    • Joined on 08-01-2007, 6:12 PM
    • Costa Rica
    • Posts 5

    Hello,

     I'm using  jQuery to show and hide a div in my page... I wrote this in codeinline:

     

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

    <script type="text/javascript">

    $(document).ready(

    function() {

    $('#remindershide').hide();

    $('#slick-slidetoggle').click(

    function() {

    $('#remindershide').slideToggle(400);return false;

    });

    $('#cancelReminder').click(

    function() {

    $('#remindershide').slideToggle(400);

    return false;

    });

    });

    </script>

     

    Everything is ok so far, I had to put a Timer and update some data from condebehind, the problem is that, after every update my slick-slidetoggle div loose all the java functionality... what am I doing wrong???

     

    Thanks

     

     

     

  • Re: jQuery methods and UpdatePanel

    12-03-2007, 7:30 PM
    Answer
    • Loading...
    • gt1329a
    • Joined on 06-24-2002, 12:53 AM
    • Atlanta
    • Posts 1,696

    What's happening is your UpdatePanel refreshes are reverting the DOM back to how it was before jQuery wired up those handlers.  The quick and dirty fix is to move that jQuery code into pageLoad() instead of $(document).ready(), since pageLoad fires after every partial postback.

Page 1 of 1 (2 items)
Microsoft Communities
Page view counter