a process that will take 30 seconds

  • Thread starter Antonio Policelli
  • Start date
A

Antonio Policelli

Hello, please tell me how to do this..
I have a web page that a user can manipulate and work with a database
object. it is not important what that is but for the user to start on
a new object, they must request that one be created. with a sql
server stored procedure, the object takes about 30-45 seconds to
create itself.

i want to give a user a form and when they click the button the object
gets created. when this happens, i want the button they just pushed
to not be pushable again. i would also like a popup window with maybe
a prograss bar on it or it could just be a light that moves from side
to side like the black kit car does.

so... how do i make the button unpushable and how do i make the popup
window come up and run while the object is being created but when the
object is done the popup goes away or just says "done" and user can
click "close me"

thank you
 
W

WizyDig

You could spawn a seperate thread of execution on the stored procedure call,
then have some java script on the client side that polls your asp.net page
every 10 seconds. the progress bar would be difficult to make acurate
unless you could break you stroed procedure into peices. if you give a
weight to each piece you could then show actually progress. other wise you
could have it based on the number of java script generated submits in you
polling script. As far as the button goes you can disable it on the first
postback.

-wiz
 
V

vMike

Antonio Policelli said:
Hello, please tell me how to do this..
I have a web page that a user can manipulate and work with a database
object. it is not important what that is but for the user to start on
a new object, they must request that one be created. with a sql
server stored procedure, the object takes about 30-45 seconds to
create itself.

i want to give a user a form and when they click the button the object
gets created. when this happens, i want the button they just pushed
to not be pushable again. i would also like a popup window with maybe
a prograss bar on it or it could just be a light that moves from side
to side like the black kit car does.

so... how do i make the button unpushable and how do i make the popup
window come up and run while the object is being created but when the
object is done the popup goes away or just says "done" and user can
click "close me"

thank you

One other possible solution is once the use clicks the button you can place
an item in Cache on the server side that is unique to the particular user
(maybe some kind of id at postback) and have it expire in one minute or so.
You can check for the cache item on subsequent clicks and just do nothing if
the item exists in cache. You can also clear the cache item once the process
is complete so subsequent processes from the user get executed.
Mike
 
V

vMike

Antonio Policelli said:
Hello, please tell me how to do this..
I have a web page that a user can manipulate and work with a database
object. it is not important what that is but for the user to start on
a new object, they must request that one be created. with a sql
server stored procedure, the object takes about 30-45 seconds to
create itself.

i want to give a user a form and when they click the button the object
gets created. when this happens, i want the button they just pushed
to not be pushable again. i would also like a popup window with maybe
a prograss bar on it or it could just be a light that moves from side
to side like the black kit car does.

so... how do i make the button unpushable and how do i make the popup
window come up and run while the object is being created but when the
object is done the popup goes away or just says "done" and user can
click "close me"

thank you

Also, here is come progress bar code. It is not mine but was posted sometime
ago by someone and was offered for use by others. You will need to modifiy
it a bit. It is started by calling startMsg()

<div id="waiting">
<table id="msgCell" width="20%" align="center"><tr><td
style="font-size:8pt;padding:2px;border:solid black 1px">
<span id="progress1">&nbsp; &nbsp;</span>
<span id="progress2">&nbsp; &nbsp;</span>
<span id="progress3">&nbsp; &nbsp;</span>
<span id="progress4">&nbsp; &nbsp;</span>
<span id="progress5">&nbsp; &nbsp;</span>
<span id="progress6">&nbsp; &nbsp;</span>
<span id="progress7">&nbsp; &nbsp;</span>
<span id="progress8">&nbsp; &nbsp;</span>
<span id="progress9">&nbsp; &nbsp;</span>

</td></tr></table>
</div>
<script language="javascript">
var progressEnd = 9; // set to number of progress <span>'s.
var progressColor = 'blue'; // set to progress bar color
var progressInterval = 500; // set to time between updates (milli-seconds)

var progressAt = 0; //progressEnd;
var progressTimer;

function progress_clear() {
for (var i = 1; i <= progressEnd; i++)
document.getElementById('progress'+i).style.backgroundColor = 'transparent';
progressAt = 0;
}
function progress_update() {
progressAt++;
{if (progressAt > progressEnd) {
progress_stop()
}
else

{document.getElementById('progress'+progressAt).style.backgroundColor =
progressColor
progressTimer = setTimeout('progress_update()',progressInterval);}}

}

function progress_stop() {
progress_clear();
window.clearTimeout(progressTimer);
// hideobj('waitingDiv','');
//hideobj('waiting','none')
}
function startMsg() {
// hideobj('waitingDiv','none');
progress_update();
}


function hideobj(objname,type) {
var div1=document.getElementById(objname);
div1.style.display = type;

}
</script>
 

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

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top