Alert or message box in


I have a web application with a long running process.
We have a function in the code behind called OptimizeFunction.
On the client side, we are runnign a loop (typically 100 count) and calling that server side function.
I want to display a progress bar or an alert message when it completes.
Alert placed on client side is firing immediately while the code is still executing server side
Is there anyway to get that message or progress bar to be displayed in this scenario?



<script type="text/javascript">
function LoopThroughRteTable()

var rtsarr = new Array();
rtsarr= document.getElementById("<%= rtInfo.ClientID %>").value.split(";");
for(var n=0; n < rtsarr.length -1 ; n++)
var sdate = document.getElementById("<%= txtDate.ClientID %>").value
var stime= document.getElementById("stime").value;
var etime = document.getElementById("etime").value;

var rteid = currentRoute[0];

PageMethods.PageMethodOptimizeFunction.(rteid, stime, etime, sdate);

alert("Process Complete.");



Server Side:

 Public Shared Sub PageMethodOptimizeFunction.(ByVal rteid As Integer, ByVal stime As String, ByVal etime As String, ByVal sdate As String)

	 ServerTwo(p1, p2)

 End Sub

 Public Shared Sub ServerTwo(byval p1 as string, byval p2 as string)

 end sub

 Public Shared Sub ServerThree(byval t1 as string, byval t2 as string)

 'Ends here. I want to show a message or progress bar or an alert
 end sub

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Melih SARICAOwnerCommented:
Open a dialog (maybe with jquery) and do the progressbar movement.

then close the dialog after ur work completed.
shahjagatAuthor Commented:

from the server side i cannot access any control as they are all shared methods.

from client side how can i do it? Anything on client side is executing immediately. Server side process takes around 30 minutes or more.
can you post some code for the above example or a link ?

Melih SARICAOwnerCommented:
U ll open and close ur dialog on client side not server side.. U must javascript or jquery

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
You need to inject client-side script from your Server-side from the function where you have:

 'Ends here. I want to show a message or progress bar or an alert

These should help:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.