I am attempting to automatically trigger the callback of a CallbackPanel using JavaScript in my WebFormUserControl every 10 seconds.
While I can trigger it with an ASPxButton and ClientSideEvents, my ultimate aim is to have it start automatically every 10 seconds.
Here is my UserControl code:
<dxcb:ASPxCallbackPanel ID="panel" runat="server" ClientInstanceName="panel" OnCallback="ASPxCallbackPanel1_Callback" Width="200px">
<PanelCollection>
<dxcb:PanelContent runat="server">
<dxcb:ASPxImage ID="ASPxImage1" runat="server" ImageUrl="~/Images/Image1.png" ShowLoadingImage="true"></dxcb:ASPxImage>
</dxcb:PanelContent>
</PanelCollection>
</dxcb:ASPxCallbackPanel>
<dxcb:ASPxButton ID="ASPxButton1" runat="server" AutoPostBack="false" Text="ASPxButton">
<ClientSideEvents Click="function(s, e) { panel.PerformCallback(); }" />
</dxcb:ASPxButton>
I attempted to fire it every 10 seconds like this:
<script type='text/javascript'>
setInterval(function () { panel.PerformCallback(); }, 10000);
</script>
Is it possible to achieve my goal?
If so, please provide some helpful code.
Thank you :)