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?
Melih SARICAConnect With a Mentor IT ManagerCommented:
U ll open and close ur dialog on client side not server side.. U must javascript or jquery
Melih SARICAIT ManagerCommented:
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 ?

guru_samiConnect With a Mentor Commented:
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:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.