How can I use JQuery UI Progressbar inside Updatepanel?
When I try to do the following, progresbar is not being updated when it's inside updatepanel.
<script type="text/javascript">
$(document).ready(function() {
$("#progressbar").progressbar({ value: 0 });
$("#progressbar").css({ 'background': 'LightYellow' });
$("#progressbar > div").css({ 'background': '#3366CC' });
});
</script>
<script type="text/javascript">
var counter = 0;
function UpdateProgress() {
$("#progressbar").progressbar("value", counter);
counter = counter + 10;
if (counter >= 100) {
counter = 0;
}
else
setTimeout('UpdateProgress()', 1000);
}
</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Button1" OnClick="Button1_Click" />
<asp:panel ID="Panel1" runat="server" Visible="True">
<div id="progressbar" style="height:30px;"></div>
</asp:panel>
</ContentTemplate>
</asp:UpdatePanel>
Code-behind:
protected void Button1_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "<script language='javascript'>UpdateProgress();</script>", false);
}