Solved

spinning wheel with update panel

Posted on 2011-02-15
6
1,551 Views
Last Modified: 2012-05-11
Hi,

I have a search that I am doing that can take a few seconds to come back.

However it isn't blatently obvious that anything is happening so I want to use the spinning ajax wheel.

I have my code inside an <asp:updatepanel and want to display the wheel while the search is happening.

I have the code below but the wheels doesn't show which is fair enough.

How is this normally done?
Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
        Dim suppliers As List(Of Supplier) = Nothing

        Try
            If txtSearchTerm.Text <> "" Then
                pnlWaiting.Visible = True 'this is where the wheel should become visible

                suppliers = New List(Of Supplier)

                suppliers = HelperGeneral.GetSuppliers(txtSearchTerm.Text)

                If suppliers.Count > 0 Then
                    rptSuppliers.DataSource = suppliers
                    rptSuppliers.DataBind()

                    lblResultCount.Text = "Found " & suppliers.Count & " Suppliers matching the search criteria."

                    pnlSupplierDisplay.Visible = True
                Else
                    lblResultCount.Text = "No Suppliers matching the search criteria."
                End If

                pnlWaiting.Visible = False 'and then where it is hidden again.
            End If
        Catch ex As Exception
            Throw
        End Try
    End Sub

Open in new window

0
Comment
Question by:scm0sml
  • 4
  • 2
6 Comments
 
LVL 10

Expert Comment

by:John Claes
ID: 34895726
the issue is here that a redrawn only occures After the Javascript has finished working and then you already hidden the wheel again.

Thing is here that you should ensure the wheel is visible and giving a function to call when shown
Then when the wheel is shown it must call the given function.

I'll look in my archive for a code-example
0
 

Author Comment

by:scm0sml
ID: 34895745
OK I'd appreciate an example!! Thanks in advance.
0
 
LVL 10

Expert Comment

by:John Claes
ID: 34895766
Ok :

This might help faster :
I've taken my needed code from

http://www.codeproject.com/script/Articles/ArticleVersion.aspx?aid=35061&av=6251
0
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 10

Expert Comment

by:John Claes
ID: 34895781
And this was the other Source of my Code :

http://www.codeproject.com/KB/aspnet/PleaseWaitButton_ASPNET.aspx
0
 
LVL 10

Accepted Solution

by:
John Claes earned 500 total points
ID: 34895832
WHat happens  :


The button's onclick is altered so 2 things hapepn instead of only the Call to the Server
The call is performed and then the javascript will show the Waiting image and disable all controls....


When the Callback (server-side) is done the page will refresh itself to show the server-side answer and the waiting image will be hiden again.

you can write this very easly yourself, but then you have to add it everywhere yourself.

regards

poor beggar


0
 

Author Comment

by:scm0sml
ID: 34896055
I wrote it myself in the end as it is only needed in the one place but thank you for the idea!!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Syntax Error 2 64
Replace &lt; with < 14 59
Initial get page response times and IIS8 15 50
How to have a gridview column with multiple items in a column row. 2 23
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
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…

770 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