I added a script manager to the master page:
<asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptLocalization ="true" EnableScriptGlobalization ="true" EnablePartialRendering="true" >
</asp:ScriptManager>
MyPage.aspx (Located in contentplaceholder of master page)
<asp:UpdatePanel ID="upMain" runat="server" UpdateMode="Conditional" EnableViewState="true">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnRefresh" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:PlaceHolder ID="placeHolder1" runat="server" EnableViewState="true"></asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
Code snippet from MyPage.aspx:
$(document).ready(function () {
setInterval(myfun, 20000);
});
function myfun() {
var btn = document.getElementById('<%=btnRefresh.ClientID%>');
btn.click();
}
I am populating a dynamic table containing user controls on the place holder. Initially, the user controls are visible on load. However, after an Async postback is triggered every 20 seconds, the user controls disappear. Despite checking with firebug that they are present, they do not render properly. I am recreating them during the async postback but they appear empty. Can anyone provide assistance with this issue?