0

Good Day Every one,

So here is my code:

I have a Div in my aspx page that contains a loading bar gif image

            <div  runat="server" id="divwait"  style="border-right: #808080 1px solid; border-top: #808080 1px solid;
z-index: 100; left: 570px; border-left: #808080 1px solid; border-bottom: #808080 1px solid;
position: absolute; top: 401px">
<div class="body" style="padding-right: 10px; padding-left: 10px; border-left-color: #808080;
    border-bottom-color: #808080; padding-bottom: 10px; border-top-style: solid;
    border-top-color: #808080; padding-top: 10px; border-right-style: solid; border-left-style: solid;
    background-color: #f2f2f2; border-right-color: #808080; border-bottom-style: solid">
    <img alt="" src="Images/ajax-loader.gif" />&nbsp;<br />
    <asp:Label ID="Label7" runat="server" BackColor="White" BorderColor="White" Text="Processing transaction. Please wait."
        Width="219px" ForeColor="Black"></asp:Label></div>

what I'm trying to do is to invoke/open the div upon button click that's why i use this code in my button click

  protected void uploadButton_Click(object sender, EventArgs e)
    {

        divwait.Visible = true;
        // do serverside process after showing the div
     }

the problem is that when i click the uploadbutton, it doesn't view the divwait before doing the processes below.
What i aim on doing is making a please wait loading bar that would notify the users to please wait because the processes that is going to take place in the upload button takes some time to finish.

I'm really sorry if this is a newbie question i have just started learning programming.
im using VS 2005/.net2.0 and i cannot use ajax as what i have saw in other examples.

thank you for your help and kind understanding.

**EDIT
In the Page Load i have hid the div

  if (!Page.IsPostBack)
        {
            divwait.Visible = false;

        }

the div should only be shown upon button click and while the sytem do it's work.

if you can recommend also recommend other process to do this, that would be highly appreciated.

Albert Laure
  • 1,702
  • 5
  • 20
  • 49
  • Have a look at http://stackoverflow.com/questions/12994600/loading-screen-using-jquery – Paul Zahra Oct 21 '13 at 08:38
  • I don't understand why the div should not be visible at the beginning. Does the `container` css class hide the control? – Paolo Tedesco Oct 21 '13 at 08:38
  • @PaoloTedesco i hid it on page load because it should only be shown upon clicking the Upload button. i also removed the `Container` Css i have no container css sorry for the typo i forgot to delete it, those where the products of trying out codes while searching – Albert Laure Oct 21 '13 at 08:43
  • You should specify that in the question... – Paolo Tedesco Oct 21 '13 at 08:47

1 Answers1

0

In your Page_Load you should probably hide the div only if IsPostBack is false:

if (!IsPostBack) {
    // first time we load the page, hide the div
    divwait.Visible = false;
}
Paolo Tedesco
  • 55,237
  • 33
  • 144
  • 193