473,385 Members | 1,449 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,385 software developers and data experts.

How to update a label using Javascript?

In my asp.net 2.0 web application, I would like to display the process
progress information in the browser. The progress info is displayed
one after another with 1 or 2 seconds delay in between them. I
believe you guys have seen this a lot in a DOS console.

I have been trying this in my code-behind in C# for a few days with no
luck.

I think this must be achievable through javascript. But, I am new to
javascript, could you guys give me a hint on how to do this in
javascript? Thanks.
Dec 23 '07 #1
8 2320
My Pet Programmer said the following on 12/23/2007 5:08 PM:
David Mark said:
>As written, there is no way to stop this interval.

You're right, I didn't put a stop in. He should only have it run during
the update and then stop. Excellent point, I should have paid better
attention to detail.
And at least tested it before you posted it :)
>Why getTimeMillis?

Is there a performance hit, or just a curiosity.
There is always a "performance hit" when you use a property that doesn't
exist.
It makes it clearer what I'm doing in the code, I think. If it's inefficient, let me know
and I'll just comment better.
See my other reply to you about using a queryString.
Ok, so an updated code listing then:

<script type="text/javascript">
<snipped a lot of code to do a 3 line project>
Is that a little beter?
Not really :)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 23 '07 #2
Randy Webb said:
>
I'm not sure how to take that.
It was meant respectfully. I'm going to lay back and watch for a while,
since it seems I'm not paying any attention to detail.

~A!
Dec 23 '07 #3
My Pet Programmer said the following on 12/23/2007 6:29 PM:
Randy Webb said:
>>
I'm not sure how to take that.

It was meant respectfully. I'm going to lay back and watch for a while,
since it seems I'm not paying any attention to detail.
Fair enough and thank you for a compliment.

Don't just "lay back" though. You will learn a lot quicker if you take a
post that interest you, try to come up with a solution, then test it.
Then try to break it, then test it some more, then see how it stands up
and compares to other solutions posted.

And get Firefox :)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 24 '07 #4
My Pet Programmer said the following on 12/23/2007 6:35 PM:
David Mark said:
>On Dec 23, 5:08 pm, My Pet Programmer <anth...@mypetprogrammer.com>
wrote:
<snip>
>>And the usage would be:

var updater = new StatusUpdater("myImageId", "myLabelId");
updater.start();
updater.stop();

And you'd call updater.start() when you started the remote procedure,
then updater.stop() when you finished.

Is that a little beter?

Not really.

Ok, you got me, I shouldn't have replied to this at all. I don't know
what the hell I'm even thinking today, but I sure as hell shouldn't be
writing code I don't know enough about.
And if you don't write it, you won't learn it, and where will that get
you? I have had my head bashed in so many times here over code I posted
I stopped letting it bother me.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 24 '07 #5
Randy Webb said:
My Pet Programmer said the following on 12/23/2007 6:29 PM:
>Randy Webb said:
>>>
I'm not sure how to take that.

It was meant respectfully. I'm going to lay back and watch for a
while, since it seems I'm not paying any attention to detail.

Fair enough and thank you for a compliment.

Don't just "lay back" though. You will learn a lot quicker if you take a
post that interest you, try to come up with a solution, then test it.
Then try to break it, then test it some more, then see how it stands up
and compares to other solutions posted.

And get Firefox :)
Firefox is my primary, I only use IE at all because I have to test in
it. I usually build in FF, get it right, then test in IE and work around
broken stuff, which is getting less each time, with the help of folks
just like you.

~A!
Dec 24 '07 #6
Randy Webb said:
And if you don't write it, you won't learn it, and where will that get
you? I have had my head bashed in so many times here over code I posted
I stopped letting it bother me.
Sounds like a plausible way to look at things, thanks for that. I'm
reading that best practices doc over at Javascript Toolbox right now,
actually.

~A!
Dec 24 '07 #7
In comp.lang.javascript message <fk**********@registered.motzarella.org>
, Sun, 23 Dec 2007 16:25:02, My Pet Programmer
<an*****@mypetprogrammer.composted:
new Date().getTimeMillis();
Which browsers implement that?

Please post only code that has been tested, and use copy'n'paste to do
it.

--
(c) John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Dec 24 '07 #8
~A!
On Dec 24, 1:06 pm, Dr J R Stockton <j...@merlyn.demon.co.ukwrote:
In comp.lang.javascript message <fkmjnj$q2...@registered.motzarella.org>
, Sun, 23 Dec 2007 16:25:02, My Pet Programmer
<anth...@mypetprogrammer.composted:
new Date().getTimeMillis();

Which browsers implement that?

Please post only code that has been tested, and use copy'n'paste to do
it.
None, actually. It was an egregious and disgusting public display of
incompetence and lack of attention to detail. I've learned my lesson,
and I will not let it happen again.

~A!
Dec 25 '07 #9

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

Similar topics

2
by: Manish | last post by:
Hey folks I am having a weird problem in ASP .Net. My page is in C#. I have a datagrid, which populates based on selection in drop down box on ASP page. This datagrid has template textbox colum in...
1
by: nospamjac | last post by:
Hi, Is there a way to update the text of an asp:label on a webform without refreshing the entire page? What is called by button clicks and other events that refresh a webform control? See the...
0
by: Metal2You | last post by:
I'm working on an ASP.NET 2.0 application in Visual Studio 2005 that accesses a Sybase database back end. We're using Sybase SQL Anywhere 9.0.2.3228. I have installed and registered the Sybase...
2
by: andrew.roberts | last post by:
This is my second post now on this subject has I seem to be getting no where and the problem is really starting to bug me now. I can get a datagrid into an editable state but then neither the...
8
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In...
2
by: =?Utf-8?B?TUNN?= | last post by:
I have an asp.net page that contains an update panel. Within the update panel, controls get added dynamically. During partial page post backs the controls within the panel will change. I have a...
2
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to...
9
by: Linda | last post by:
I have 2 labels on a page...(weight, age). The user will click on the label to set the focus on a label. There will be 10 buttons (0-9) on the page. I want to update the label as the user clicks...
10
dj12345
by: dj12345 | last post by:
Hi, (Asp.net + Ajax) I am creating a page which will fetch data from server without postbak of a page.. I have 2 controls on this page TextBox and Lable. I have assigned TextBoxWatermark...
5
by: handoyo | last post by:
Hi all,i'm trying to show updated data in existing html td.. For example i got column that show last modified datetime,then i want to update data again,the column will changed to current time without...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.