Reading Session value from WebServer which processing the aspx page
I'm developing a simple progress bar that display the
value for the task completed.
It has following files
1. A "StartTask.aspx" file that has a command
button "Start". When user clicks on this button, the file
is submitted to ASP.NET and the process goes through the
loop from 1 to 1000000. In every 10000th Counter, it
updates the session
variable "CurrentValue"=CurrentCounterValue (in this case
it will be 10000, 20000, 30000 etc) and fire the
Thread.Sleep(0) so that other waiting process can be run.
After it reaches 1000000, IT AGAIN GOES THROUGH ANOTHER
LOOP FOR 1 to 10000 and update the value of "CurrentValue"
in every 1000th count.
Once this small loop is completed, it goes through another
loop for 1 to 100000 and updates the value of
the "CurrentValue" once it is completed. The it returns
the page to the browser.
2. A Webservice file (Progress.asmx) with web
method "getCurrentValue()" that returns the value of the
session object(!) "CurrentValue".
3. A HTML file (Progress.html) that call the
webmethod "getCurrentValue()" in every 1000ms. I'm
using "WebService Behaviour" to call the webmethod without
refreshing the html file.
When user clicks on the "Start" command button, it opens a
new window with the "Progress.html" file and submits
the "StartTask.aspx" file also.
As the StartTask processed, obviously it updates the value
for "CurrentValue" in every 10000th count. BUT value
of "CurrentValue" is updated in the "Progress.html" ONLY
WHEN the process of the "StartTask.aspx" is completed.
So, my question is how to run these task simultaneously so
that I can get the updates in the "Progress.html" when the
value of the session "CurrentValue" is changed by
the "StartTask.aspx" (AND BEFORE COMPLETION OF PROCESSING
OF THE StartTask.aspx page!!!).
I also tried changing [Thread.Sleep(0) to Thread.Sleep
(3000)] in the "StartTask.aspx" and also by increasing
value of [ maxconnection="20" ] in the web.config file.
But these don't solve the problem!
Can anyone please help me to solve this problem!
|All times are GMT. The time now is 05:35 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.