Do I need to raise an event?

Posted on 2006-04-25
Last Modified: 2012-05-05
Hi everyone,

I've written an page that allows for a spreadsheet to be selected (browsed for) and imported into our SQL database. That works fine - however as it takes about 10 minutes to process and upload all the data I was hoping to display a graphic to the user to show that the data is loading.

When the import button is clicked, obviously a postback is raised, I display my graphic (or so I thought) using an image control with runat=server and the import goes ahead... however, the graphic never gets displayed - it goes striaght into the import code.  I presume the grapic hasn't been rendered on the page?

So my question is, how can I get the graphic to render before it hits the import code? Do I need to raise an event or something?  When the import finished I then hide the image.

Question by:obyapka
    LVL 6

    Accepted Solution

    You must use Javascript. It is display graphic before processing is hand on server. Graphic is displeyd as last action before postback, after postback page is reloaded and wait message disappears.
    Try use this:
        <script type="text/javascript">
            function PleaseWait()
                // make the mouse cursor into the "wait" hourglass
       = "wait";
                document.getElementById("lresult").innerText = ""
                // show the please wait div
                    var message = document.getElementById( "PleaseWait" );
                    if (message) = "block";

                // allow the form to post back
                return true;
        <style type="text/css">#PleaseWait {
          BORDER-RIGHT: #000 1px solid; PADDING-RIGHT: 20px; BORDER-TOP: #000 1px solid; DISPLAY: none; PADDING-LEFT: 20px; BACKGROUND: #ffff9b; LEFT: 50px; PADDING-BOTTOM: 20px; BORDER-LEFT: #000 1px solid; WIDTH: 200px; PADDING-TOP: 20px; BORDER-BOTTOM: #000 1px solid; POSITION: absolute; TOP: 50px

    <form onsubmit="PleaseWait()" runat="server">
            <div id="PleaseWait" style="LEFT: 51px; TOP: 37px">
                <p style="TEXT-ALIGN: center">
                    Please wait....
    LVL 1

    Author Comment

    At your suggestion I've created a DIV block around the image with display style of none, and I've tied the Update button to some javascript, so that when its precessed it displays the image in a DIV block - all that is great, however the image is an animated GIF which doesn't animate when the IE status bar is slowly growing!!  Does this happen with all GIF files or is there a way around it?


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now