Long running searches

D

David Kleyman

Hello

I am trying to display "Please wait..." message on a page while page is
retrieving data from SQL server
I have this code in place but it does not seem to be working
Private Sub cmdSearch_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdSearch.Click

...

lblMessage.Text = "Please wait..."

' do the search

.....

end Sub



Is there something I am doing wrong

Thank you

David
 
H

Hermit Dave

The reason it is not working is because you are assigning the value to the
label in the event handler for command object.
and the actual rendering of the server control doesnt start until after the
end.

What you could try is the classic

Response.Write("Please wait");
Response.Flush();

' your code to do the search

HTH
 
C

Curt_C [MVP]

Correct... that's due to the client never getting the info until the data is
rendered......
There were some suggestions posted on this earlier today that you should
look at. If you look back you should see them.
 
D

David Kleyman

I can't find the posts that you referring to

Can you point them out?

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,186
Latest member
vinaykumar_nevatia

Latest Threads

Top