简体   繁体   English

请等待按钮上的加载栏单击不显示

[英]Please Wait Loading Bar on button click not showing

Good Day Every one, 今天是个好日子,

So here is my code: 所以这是我的代码:

I have a Div in my aspx page that contains a loading bar gif image 我的aspx页面中有一个Div,其中包含一个加载栏gif图像

            <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 我想做的是单击按钮时调用/打开div,这就是为什么我在按钮单击中使用此代码的原因

  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. 问题是,当我单击上载按钮时,在执行以下过程之前不会查看divwait
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. 即时通讯使用VS 2005 / .net2.0,我不能像其他示例中那样使用ajax。

thank you for your help and kind understanding. 感谢您的帮助和友善的理解。

* *EDIT * *编辑
In the Page Load i have hid the div 在页面加载中,我已经隐藏了div

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

        }

the div should only be shown upon button click and while the sytem do it's work. div应该仅在单击按钮时显示,并且在系统运行时显示。

if you can recommend also recommend other process to do this, that would be highly appreciated. 如果您可以建议也建议其他过程来执行此操作,将不胜感激。

In your Page_Load you should probably hide the div only if IsPostBack is false: 在您的Page_Load ,仅当IsPostBack为false时,才应隐藏div:

if (!IsPostBack) {
    // first time we load the page, hide the div
    divwait.Visible = false;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM