Alert or message box in asp.net

Hi,

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?

Thanks

 
javascript:

<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.");

}

</script>

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)


	ServerThree(t1,t2)
 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

shahjagatAsked:
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.
0
shahjagatAuthor Commented:
non_zero,

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 ?

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

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
guru_samiCommented:
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:
http://dotnetslackers.com/articles/aspnet/JavaScript_with_ASP_NET_2_0_Pages_Part1.aspx#s6
http://weblogs.asp.net/gurusarkar/archive/2010/12/18/part-2-showing-asp-net-validation-summary-in-a-custom-dialog-server-side.aspx
0
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
ASP.NET

From novice to tech pro — start learning today.