Wednesday, August 25, 2010

How to use Jquery in Update panels

I you have this Jquery method to be used

$(function () {

// initialize scrollable
$(".scrollable").scrollable();

});

Then use it inside a function as shown

function BindEvents() {

$(function () {

// initialize scrollable
$(".scrollable").scrollable();

});
}

Then add this script inside the update panel as shown below


<asp:UpdatePanel ID="UpdatePanel9" runat="server">
<ContentTemplate>

<script type="text/javascript">
Sys.Application.add_load(BindEvents);
</script>

//Ur Code Here

</ContentTemplate>
</asp:UpdatePanel>