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.

4

1 回答 1

0

在你的Page_Load你应该隐藏 div 只有当IsPostBack它是假的:

if (!IsPostBack) {
    // first time we load the page, hide the div
    divwait.Visible = false;
}
于 2013-10-21T08:46:47.673 回答