I'm creating a dashboard, and i've decided to put all my asp charts into their own update panels because loading at once takes too long. the goal is to have them load in a sequential order.
the update panels are created programatically when the page loads. There is data related to the report stored in DataTable, myDT.
I am using a timer to wait 2 seconds before starting this process. once the process starts though, it behaves as though i am loading all update panels at one time. What am i doing wrong, or what do i need to add?
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:PlaceHolder ID="PlaceHolder1" runat="server" ViewStateMode="Enabled"></asp:PlaceHolder>
<asp:Timer ID="Timer1" runat="server" Interval="2000">
</asp:Timer>
<script type="text/javascript">
$(document).ready(function () {
$('.tabs').tabs();
});
</script>
</asp:Content>
protected void Timer1_Tick(object sender, EventArgs e)
{
Timer1.Enabled = false;
try
{
var query = from t in this.myDT.AsEnumerable()
select new
{
RunScheduleID = t["RunScheduleID"],
PBuild = t["ProductBuild"],
StartDate = t["StartDate"],
EndDate = t["EndDate"]
};
int rms = 0;
foreach (var q in query)
{
UpdatePanel p = (UpdatePanel)PlaceHolder1.FindControl("up_" + rms.ToString());
PlaceHolder ph = (PlaceHolder)PlaceHolder1.FindControl("ph_" + rms.ToString());
System.Threading.Thread.Sleep(4000); // simulate time it takes to run process
ph.Controls.Clear();
p.Update();
}
}
Catch (Exception ex)
{
throw ex;
}
)