Are you sure the event is not firing, I have re-created
your Web Form as best I can with the information provided
and the event fires ok, but it still does not write
anything to the page.
Not sure why this is, but will look at it some more
Mike Hanson
MCSE, MCSD, MCDBA, MCT
>--Original Message--
>Dear All,
> I try to print some message continually, so I put a
timer component in
>my web form, and I already config the Timer1 as below.
>Timer1.enabled=true
>Timer1.interval=100
> Private Sub Timer1_Elapsed(ByVal sender As Object,
ByVal e As
>System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed
> Response.Write("hello,world")
> End Sub
> but I found the timer1 elasped doesn't run, who can
tell me how to do?
> Any point would be great appreciate.
>Eric.
>
>.I think part of your problem is that the Timer1_Elapsed
event is firing even before the Page_Load event fires.
Try this and see if it helps
1. Add a Boolean variable to your class, with an intial
value of false
2. Set this variable to true in your Page_Load event
3. In the Timer1_Elapsed event only call Response.Write()
if the variable is true.
NB: I haven't provided the code as I don't really do
VB.NET and didn't want to give you an incorrect example.
Mike Hanson
MCSE, MCSD, MCDBA, MCT
>--Original Message--
>Are you sure the event is not firing, I have re-created
>your Web Form as best I can with the information
provided
>and the event fires ok, but it still does not write
>anything to the page.
>Not sure why this is, but will look at it some more
>Mike Hanson
>MCSE, MCSD, MCDBA, MCT
>>--Original Message--
>>Dear All,
>>
>> I try to print some message continually, so I put a
>timer component in
>>my web form, and I already config the Timer1 as below.
>>
>>Timer1.enabled=true
>>Timer1.interval=100
>>
>> Private Sub Timer1_Elapsed(ByVal sender As Object,
>ByVal e As
>>System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed
>>
>> Response.Write("hello,world")
>> End Sub
>>
>> but I found the timer1 elasped doesn't run, who can
>tell me how to do?
>> Any point would be great appreciate.
>>
>>Eric.
>>
>>
>>
>>.
>>
>.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment