473,662 Members | 2,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3977
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*****@supane t.com> wrote in message
news:c0******** **@titan.btinte rnet.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.NOS PAM> wrote in message
news:uD******** *****@tk2msftng p13.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*****@supane t.com> wrote in message
news:c0******** **@titan.btinte rnet.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="Javas cript">
function progress(pstrPe rcent){
var pobjButton = document.getEle mentById('myBut ton');
pobjButton.valu e = 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="""Jav ascript""">prog ress('" & pstrProgress
& "');</script>"
%>

</body>
</html>

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

pstrProgress = "10"
Response.Write "<script language="""Jav ascript""">prog ress('" & pstrProgress
& "');</script>"

Apologies for any typos.

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

Hope this helps.

Chris.

"rob" <rl*****@supane t.com> wrote in message
news:c0******** **@sparta.btint ernet.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.NOS PAM> wrote in message
news:uD******** *****@tk2msftng p13.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*****@supane t.com> wrote in message
news:c0******** **@titan.btinte rnet.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=VBScri pt %>
<%Response.Buff er=true%>
<HTML><BODY>
<style type="text/css">
..pBar {
border: thin inset black;
background-color:navajowhi te;
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.widt h.replace("%"," "));
hr1.className=" 2";
var newWidth=curwid th + Number(nPercent );
if (newWidth % 20 == 0)
{
spTime.innerTex t=newWidth
}
if (newWidth > 100){
newWidth = 0
}
hr1.style.width = newWidth + "%";
timeID = setTimeout("doi t()",100);
}
//spTime.innerTex t="0.1"
setTimeout("doi t()",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(ti meID);
progressBar.sty le.display="non e";
spTime.innerTex t="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.NOS PAM> wrote in message
news:uk******** ******@TK2MSFTN GP11.phx.gbl...
<html>
<head>
<script language="Javas cript">
function progress(pstrPe rcent){
var pobjButton = document.getEle mentById('myBut ton');
pobjButton.valu e = 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="""Jav ascript""">prog ress('" & pstrProgress & "');</script>"
%>

</body>
</html>

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

pstrProgress = "10"
Response.Write "<script language="""Jav ascript""">prog ress('" & pstrProgress & "');</script>"

Apologies for any typos.

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

Hope this helps.

Chris.

"rob" <rl*****@supane t.com> wrote in message
news:c0******** **@sparta.btint ernet.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.NOS PAM> wrote in message
news:uD******** *****@tk2msftng p13.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*****@supane t.com> wrote in message
news:c0******** **@titan.btinte rnet.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
4101
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, if I wanted to have a percentage progress counter that was constantly updating. I'm unsure how to do this without printing to a brand new line. Any help would be greatly appreciated. Thanks. Daniel
4
2013
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 datagrid isn't going to work). On this page, people can update a variet of records. On submit, I want to then go in and update all of the records. Normally, I'd make each form element include a runat: server and then declare it in my codebhind so I...
4
1383
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 see how the load is progressing, so I have a counter textbox, which I have passed to the load object as a texbox (ByRef). For every 100 records that are loaded, I update the Text attribute for the textbox with a new number. However, the textbox...
7
2574
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 upgraded to VB.NET, and I have a lot of catching up to do. That being said, I have come a long way in a short while, however, I am stumped at the moment. I have read through days of posts, but have not been able to address my specific question, so...
5
5425
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 updated and no errors returned. Here is the source.. Please help. <asp:GridView ID="gvEvidence" runat="server" AllowPaging="True" AllowSorting="True"
1
1312
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 workerthreads. The worker threads need to update a textbox on Form1 as they progress. The question is, how do I create the necessary delegates / whatever to update the textbox in a thread - safe manner? The classes created in svrList are all...
3
1877
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 exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax...
4
1209
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 of displaying a progress window. Ideally, the progress window should have a textbox control that display very fast the subject of each email it is examining. The user would not be able to read the contents of the textbox, but he would be happy...
5
1710
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 when things go funny, the second another postback occurs it complains. I thought that a textbox would have it's contents escaped in on way or another, obviously not, any idea how I can get the page to ignore it's contents? I don't want it to use...
0
8435
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8857
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8768
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1754
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.