Click here to Skip to main content
16,014,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have two textboxes and two calenderextender controls and one submit buttons in tabpanel.
Whenever I select two dates and press submit button it will generate a bar cart in the tabpanel. So I am using a processbar before generating barchart. Now I want to hide the page whenever I click the submit button and show the processbar before generating the bar charts. How can I hide the table or table data. I am using some code but it is not working properly. The processbar is showing here and there and the table is not hiding.

XML
<td id="Td1" runat="server" align="center" valign="middle" >
<asp:Panel ID="PanelProcessBar" runat="server" >
  <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="2000" DynamicLayout ="true">
    <ProgressTemplate>
      <asp:Image ID="ImgProcessBar" runat="server" ImageUrl="~/images/ajax-loader.gif" />
    </ProgressTemplate>
  </asp:UpdateProgress>
</asp:Panel>


C#
protected void BtnShow_Click(object sender, EventArgs e)
{
  System.Threading.Thread.Sleep(2000);
  if (IsPostBack)
  {
    TdTabContainer.Visible = false;
  }
  Get_BarChart();
}


If anybody knows a solution, please help me.
Thank you!
Posted
Updated 21-Nov-10 20:12pm
v2

The reason the update bar isn't being shown is the DisplayAfter is set to 2000 (meaning the update won't be shown unless there is a delay of 2 seconds), but so is your sleep so just as the update bar is about to show, your page replies.
Either set the sleep to 3000 or set DisplayAfter to 1000 and you should see the control for one second (give or take a few milliseconds :-))
 
Share this answer
 
Comments
Dalek Dave 22-Nov-10 4:05am    
Well spotted!
Have a look at this article: Customizable 'Loading' Control for Web Applications with Designer Support[^]

You can use this control to get the desired behavior.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900