I need 'how to' on web form timer in vb.net...

T

Trint Smith

I know how to set a timer in a windows app, but is it possible to fire
an event, with out too much processing, every 1000 mil. sec.s using the
web form timer? I noticed there's no 'tick' in the declairations
choices on the code page after I dragged a timer control over to my aspx
page. How can I do this?
Thanks,
Trint

..Net programmer
(e-mail address removed)
 
D

Dominique Vandensteen

System.Windows.Forms.Timer
has a property Interval to set the interval (in milliseconds)
has an event Tick, is raised when interval has elapsed
 
C

CJ Taylor

Trint,

How do you expect the timer to work ever 1000 milliseconds... or every 1
second?

Even if there WAS a refresh, what are you going to have it do? Your going
to have the page refresh itself every second that someones on it? The
postback alone will tie up all the resources for at least one second.

You gotta remember that the web is stateless dude... and just cause its
possible in winforms, doesn't mean possible in webforms. How much web
experience do you have trint?

-CJ
 
C

CJ Taylor

Could you give me more detail on this instead of pointing me to an auction
page? Where am I supposed to look?

-CJ
 
C

CJ Taylor

Dude, this is a flash program doing this, not .NET, not PHP, not even
JavaScript (which is the other programatic way to do this...
javascript.internet.com is a good resource).
 
C

Cor

Hi,

CJ, that I thought also, look in the original thread, I did make something
nice for this.

(Although you can ask yourself if you should be happy with it)

:)

Cor
 
T

Trint Smith

CJ,
Is there a way to, with a small view of the 2nd aspx in the ifram, to do
a refresh on just that form (in the iframe)?
Thanks,
Trint

.Net programmer
(e-mail address removed)
 
T

Trint Smith

I know, but shouldn't we be able to do that with vb?
Cannot vb thread to a specific area...I don't know, I'm just asking,
because my clock MUST count down with specific information from my sql
server 2k table. I have everything except that one ability (to show it
counting down)...I understand about 'refresh', but that is not
efficient. There must be a way to do this.
Thanks,
Trint

.Net programmer
(e-mail address removed)
 
C

CJ Taylor

Trint,
I know, but shouldn't we be able to do that with vb?

Should we be able to do it... The answer is, "yes." However... the part you
have to look at is "with vb", the answer "not like you want to."

Remember, ASP/ASP.NET is not a client side technology (Active SERVER Pages.
=)) , therefore it is not designed to do this. Now, it isn't to be said its
not possible with assistance from ASP (there are hundreds of examples of
using flash with ASP ) but not entirly with ASP, because again, you have a
stateless connection.

This is why languages like Java, which allows client side streaming, are
used. Or flash, which can use ASP and Java for synchronization
Cannot vb thread to a specific area...I don't know, I'm just asking,
because my clock MUST count down with specific information from my sql
server 2k table.

Again, touchy area. I understand your concern, your not the first to come
across this. I'm just telling you ways out of it. You can use the IFrame
as I suggested before, but don't forget about something as simple as "lag"
(the offset between when a packet is transmitted from the server to the time
it is received by the client) which can just upset your users if its as time
critical as that...

For you.. to be honest, I would recommend Javascript. now don't take this
the wrong way, but given your overall web experience, I wouldn't recommend
you jump into flash right away (you'll burn yourself out and hate web
development, we don't want that.) but Javascript will allow you to develop
your own sync'ing routines and learn on a little bit easier curve than
something as complex as flash.

There are many countdown scripts at javascript.internet.com, or you can use
the IFrame idea... its up to you.

-CJ

And please, when you sign your emails... put .NET Programmer, not Net
programmer... just a pet peeve...

I have everything except that one ability (to show it
 
C

Cor

Hi CJ,

Still not looked at that program I made, because of what you said I got the
idea it could be done. Therefore I find it nice if you look to it.

Did you know that "net" means in Dutch "just started as"

Cor
 
C

CJ Taylor

Cor said:
Hi CJ,

Still not looked at that program I made, because of what you said I got the
idea it could be done. Therefore I find it nice if you look to it.

Yeah, I'll be happy to look at it, just let me know where its at...
Did you know that "net" means in Dutch "just started as"

No, I didn't... is he dutch? =) If that was his intention then I take
back my statement. I'm just trying to give him some help along the way, as
we all are. =)
 
C

CJ Taylor

This thread??? Are you sure? I'm not seeing it, I only have 3 messages
from you in this thread, and none of them have source code.

-CJ
 
C

CJ Taylor

Hey Cor,

Just looked at your program, I see no reason why it shouldn't work (well
just looking at it at least). It reminds me of design patterns used by
4GuysFromRolla years back when doing database image storage (in BLOB data).
Where an ASP page streamed out the data to another ASP page in the response
buffer.

The only thing you might need to do is close your response buffer at the end
(which I believe stops the spinning globe indicating page load complete)
otherwise your page may never actually finish "loading" (which may not be
bad.. again... you can keep that buffer stream open. =0

But otherwise, nicely done.

-CJ
 

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

Top