Solved

"Busy Animation" without an UpdatePanel

Posted on 2013-01-15
3
433 Views
Last Modified: 2013-08-28
I have an Upload form on my page. Given ASP:FileUpload's proclivity for getting in a fight with the AJAX:UpdatePanel, I'm running the form sans the panel. The form runs great, but I'm getting users with 100+ thousand record files to upload, and at times it takes upwards of a minute to load their files into the database.

Now, if the AJAX:AsyncFileUpload worked on our server (there's some obscure issue with the server that forced me into using ASP:FileUpload instead) I'd be using an UpdatePanel, and subsequently an UpdateProgress... But I can't use either, as the form has to exist outside an UpdatePanel to allow the file to actually be detected.

So this brings me to the question:

Is there a simple and elegant way to implement "UpdateProgress" like functionality, without using AJAX:UpdatePanel/AJAX:UpdateProgress?
0
Comment
Question by:Paul Kahl
  • 2
3 Comments
 
LVL 41

Expert Comment

by:guru_sami
ID: 38780207
Here's some very basic way you can try:

1: Add a div and make it hidden:
2: Make it visible via jquery when your upload button is clicked.
3: The div should hide itself when the postback is finished.

Note: You can make the content of that div as fancy as you like. e.g. add an progress gif

<script type="text/javascript">
        $(function () {
            $("#btnUploadprog").click(function () {
                $("#progress").show();
            });
        });
    </script>

<asp:FileUpload ID="FileUpload1" runat="server" />
    <asp:Button ID="btnUploadprog" runat="server" Text="Upload with Progress" 
        onclick="btnUploadprog_Click" />
    <div id="progress" style="display:none">
        Upload in progress...
    </div>

Open in new window

0
 
LVL 3

Author Comment

by:Paul Kahl
ID: 38807190
I gave that a whirl, but I got nothing appearing at all.

Code used:
    <%--SAP BW Actuals Uploader--%>
    <asp:Panel ID="pnlSAPBWActuals" runat="server">
        <script type="text/javascript">
            $(function () {
                $("#btnUploadSAPBWActuals").click(function () {
                    $("#pnlUploader_SAPBWActuals_Progress").show();
                });
            });
        </script>
        <div id="pnlUploader_SAPBWActuals_Progress" style="display:none">
            <img src="images/loading_animation_liferay.gif" />
        </div>

        <div style="padding: 5px;">
            <asp:FileUpload ID="fuSAPBWActuals" runat="server" UploaderStyle="Modern" Width="500" CssClass="submit" ClientIDMode="AutoID" />
            <asp:Button ID="btnUploadSAPBWActuals" runat="server" Text="Upload" OnClick="btnUploadSAPBWActuals_Click" CssClass="submit" style="margin-left: 10px;" />
        </div>
    </asp:Panel>

Open in new window

0
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 38807518
Are you getting any javascript errors?
Make sure you have added reference to jquery.

e.g. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

774 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