473,396 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Updating textbox contents during asp progress

rob
Hi All,

I have an asp script which updates upto 300000 records each time it is run.
I would like to have a textbox which says records progressed : then in
increments of 100 or 1000 whilst the script is running. Is this possible to
do with a textbox? I've tried using the response.flush with a variable
which kinda works but it displays as follows;
1000
2000
3000
4000
....
and keeps scrolling. If its not possible to do in a textbox then is there a
way to deleting a line and overwrite it?

Many thanks in advance,
Rob
Jul 19 '05 #1
6 3956
Update the value of a button (use CSS to make it look like a textbox).

You can't update a textbox but I have done this with the button scenario -
just keep outputting script sections using Response.Write to do the update.

Chris.

"rob" <rl*****@supanet.com> wrote in message
news:c0**********@titan.btinternet.com...
Hi All,

I have an asp script which updates upto 300000 records each time it is run.
I would like to have a textbox which says records progressed : then in
increments of 100 or 1000 whilst the script is running. Is this possible to
do with a textbox? I've tried using the response.flush with a variable
which kinda works but it displays as follows;
1000
2000
3000
4000
....
and keeps scrolling. If its not possible to do in a textbox then is there a
way to deleting a line and overwrite it?

Many thanks in advance,
Rob

Jul 19 '05 #2
rob
Hi Chris,

I think im having an off day, as im unable to do this with buttons, the
best I got was 1000's of buttons to come up on the screen lol.
Any chance you could show some coding for it, just on a simple for i = 1 to
1000 some of thing.

Many thanks,
Rob
"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:uD*************@tk2msftngp13.phx.gbl...
Update the value of a button (use CSS to make it look like a textbox).

You can't update a textbox but I have done this with the button scenario -
just keep outputting script sections using Response.Write to do the update.
Chris.

"rob" <rl*****@supanet.com> wrote in message
news:c0**********@titan.btinternet.com...
Hi All,

I have an asp script which updates upto 300000 records each time it is run. I would like to have a textbox which says records progressed : then in
increments of 100 or 1000 whilst the script is running. Is this possible to do with a textbox? I've tried using the response.flush with a variable
which kinda works but it displays as follows;
1000
2000
3000
4000
...
and keeps scrolling. If its not possible to do in a textbox then is there a way to deleting a line and overwrite it?

Many thanks in advance,
Rob

Jul 19 '05 #3
<html>
<head>
<script language="Javascript">
function progress(pstrPercent){
var pobjButton = document.getElementById('myButton');
pobjButton.value = pstrPercent;
}
</script>
</head>
<body>
<input type="button" name="myButton" id="myButton" value="Progress:
0%"></input>

<%
'You ASP would be outputting the script bits here
pstrProgress = "10"
Response.Write "<script language="""Javascript""">progress('" & pstrProgress
& "');</script>"
%>

</body>
</html>

Now keep on using the following in your ASP loop (as indicated above):

pstrProgress = "10"
Response.Write "<script language="""Javascript""">progress('" & pstrProgress
& "');</script>"

Apologies for any typos.

You may need to mess with Response.Flush etc.?

Hope this helps.

Chris.

"rob" <rl*****@supanet.com> wrote in message
news:c0**********@sparta.btinternet.com...
Hi Chris,

I think im having an off day, as im unable to do this with buttons, the
best I got was 1000's of buttons to come up on the screen lol.
Any chance you could show some coding for it, just on a simple for i = 1 to
1000 some of thing.

Many thanks,
Rob
"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:uD*************@tk2msftngp13.phx.gbl...
Update the value of a button (use CSS to make it look like a textbox).

You can't update a textbox but I have done this with the button scenario -
just keep outputting script sections using Response.Write to do the update.
Chris.

"rob" <rl*****@supanet.com> wrote in message
news:c0**********@titan.btinternet.com...
Hi All,

I have an asp script which updates upto 300000 records each time it is run. I would like to have a textbox which says records progressed : then in
increments of 100 or 1000 whilst the script is running. Is this possible to do with a textbox? I've tried using the response.flush with a variable
which kinda works but it displays as follows;
1000
2000
3000
4000
...
and keeps scrolling. If its not possible to do in a textbox then is there a way to deleting a line and overwrite it?

Many thanks in advance,
Rob


Jul 19 '05 #4
Hmm - you may need to move the progress script bits *after* the closing body
tag so that the browser has had time to parse the body element?

Not sure so have a play first - I last did this about 2 years ago so it's
untested and from memory - LoL.

Chris.
Jul 19 '05 #5
rob wrote:
Hi All,

I have an asp script which updates upto 300000 records each time it
is run. I would like to have a textbox which says records progressed
: then in increments of 100 or 1000 whilst the script is running. Is
this possible to do with a textbox? I've tried using the
response.flush with a variable which kinda works but it displays as


How about a progress bar. Like this:

<%@ Language=VBScript %>
<%Response.Buffer=true%>
<HTML><BODY>
<style type="text/css">
..pBar {
border: thin inset black;
background-color:navajowhite;
padding-left:5px;
padding-right:5px
}
div.1 {
border-top:5px solid navajowhite;
border-bottom:5px solid navajowhite;
text-align: left;
background-color: navajowhite;
width: 100%;
height: 10px;
}
div.2 {
border-top:5px solid navajowhite;
border-bottom:5px solid navajowhite;
text-align: right;
background-color: blue;
color:white;
height: 10px;
}
</style>
<span id=spTime></span><BR>
<div id=progressBar class=pBar>
<div id="hr1" class=1></div></div>
<script type="text/jscript">
var timeID
function doit() {
var nPercent = Number('1');
var curwidth=Number(hr1.style.width.replace("%",""));
hr1.className="2";
var newWidth=curwidth + Number(nPercent);
if (newWidth % 20 == 0)
{
spTime.innerText=newWidth
}
if (newWidth > 100){
newWidth = 0
}
hr1.style.width= newWidth + "%";
timeID = setTimeout("doit()",100);
}
//spTime.innerText="0.1"
setTimeout("doit()",100);
</script>
<%
'Here is where the long-running script starts
dim t,diff
Response.Flush
t=now
do until diff > 5
diff = DateDiff("s",t,now)
loop
'Response.Flush
%>

<!--the rest of the page follows here-->
</BODY>
<script type="text/jscript">
clearTimeout(timeID);
progressBar.style.display="none";
spTime.innerText="Finished";
</script>
</HTML>
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #6
rob
Thanks Chris, works like a dream :o)

"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:uk**************@TK2MSFTNGP11.phx.gbl...
<html>
<head>
<script language="Javascript">
function progress(pstrPercent){
var pobjButton = document.getElementById('myButton');
pobjButton.value = pstrPercent;
}
</script>
</head>
<body>
<input type="button" name="myButton" id="myButton" value="Progress:
0%"></input>

<%
'You ASP would be outputting the script bits here
pstrProgress = "10"
Response.Write "<script language="""Javascript""">progress('" & pstrProgress & "');</script>"
%>

</body>
</html>

Now keep on using the following in your ASP loop (as indicated above):

pstrProgress = "10"
Response.Write "<script language="""Javascript""">progress('" & pstrProgress & "');</script>"

Apologies for any typos.

You may need to mess with Response.Flush etc.?

Hope this helps.

Chris.

"rob" <rl*****@supanet.com> wrote in message
news:c0**********@sparta.btinternet.com...
Hi Chris,

I think im having an off day, as im unable to do this with buttons, the
best I got was 1000's of buttons to come up on the screen lol.
Any chance you could show some coding for it, just on a simple for i = 1 to 1000 some of thing.

Many thanks,
Rob
"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:uD*************@tk2msftngp13.phx.gbl...
Update the value of a button (use CSS to make it look like a textbox).

You can't update a textbox but I have done this with the button scenario - just keep outputting script sections using Response.Write to do the update.

Chris.

"rob" <rl*****@supanet.com> wrote in message
news:c0**********@titan.btinternet.com...
Hi All,

I have an asp script which updates upto 300000 records each time it is

run.
I would like to have a textbox which says records progressed : then in
increments of 100 or 1000 whilst the script is running. Is this

possible to
do with a textbox? I've tried using the response.flush with a variable
which kinda works but it displays as follows;
1000
2000
3000
4000
...
and keeps scrolling. If its not possible to do in a textbox then is
there a
way to deleting a line and overwrite it?

Many thanks in advance,
Rob


Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Daniel Pryde | last post by:
Hi there. I hope this isn't a stupid question to ask, but does anyone know how to print out a string without moving to a new line each time and simply updating the first line. An example would be,...
4
by: Darrel | last post by:
I'm creating a table that contains multiple records pulled out of the database. I'm building the table myself and passing it to the page since the table needs to be fairly customized (ie, a...
4
by: Frank | last post by:
I am loading data through a OleDbDatareader. The load is started from a form by the user, but the actual load is done in a separate class, which is accessed from my form. Now, I want the user to...
7
by: MgGuigg | last post by:
Hello all, This is my first time posting a question to this forum, so here is hoping I am following protocol. I am scraping the rust off my old Basic programming skills, and have just recently...
5
by: teclioness | last post by:
Hi, I am using gridview and sql datasource for select and update. When I click on edit link against the records, the row is shows in edit mode. When I make a change to it, the change is not...
1
by: Bmack500 | last post by:
Hello! And thanks in advance. I have the following code which just basically creates a set of threads for me (Using svrList as my list of class instances to thread). Let's call the threads...
3
by: Trez | last post by:
Hey guys, Am new at using ASP.Net. am having some problems updating my SQL DB. whenever i try i get this Error. Can someone help me? Incorrect syntax near 'nvarchar'. Description: An unhandled...
4
by: federico | last post by:
Hello I have an application that iterates through the messages of a mailbox. The program does fine the job of moving messages that match a criteria. I would like to add to the program the capablity...
5
by: Nick | last post by:
Hey there, I'm trying to get a textbox (using ASP.NET / VB.NET) to display XML without freaking out the browser afterwards. Currently I have the textbox displaying the XML fine, but that's...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.