A Timer Problem

I

Ing. Rajesh Kumar

Hi Everybody
I want to create a timer event on my web page. Something equivalent to setTimeOut in JavaScript. I read the MSDN but still cannot make one :

I tried the following but nothing happens. Can someone tell me what i am missing ? :
<%@ Page Language="vb" %>
<%@Import NameSpace="System.Timers" %>

<script runat="server">
Sub Page_Load(Sender As Object, e As EventArgs)
txtSamay.Text = Now()
StartTimer()
End Sub

Sub StartTimer()
Dim myTimer as New System.Timers.Timer()
myTimer.Enabled = true
myTimer.Interval = 2000
AddHandler myTimer.Elapsed, AddressOf myTimer_Elapsed
End Sub

Sub myTimer_Elapsed(ByVal sender As Object, ByVal e as ElapsedEventArgs)
txtSamay.Text = Now()
End Sub
</script>

<html>
<head></head>
<body>

<form runat="server">
<asp:Label ID="Label_1" runat="server"></asp:Label><BR>
<asp:Textbox ID="txtSamay" runat="server"></asp:Textbox>
</form>
</body>
</html>
 
A

Alvin Bruney [MVP]

what's the deal with posting this all over the internet?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi Everybody
I want to create a timer event on my web page. Something equivalent to setTimeOut in JavaScript. I read the MSDN but still cannot make one :

I tried the following but nothing happens. Can someone tell me what i am missing ? :
<%@ Page Language="vb" %>
<%@Import NameSpace="System.Timers" %>

<script runat="server">
Sub Page_Load(Sender As Object, e As EventArgs)
txtSamay.Text = Now()
StartTimer()
End Sub

Sub StartTimer()
Dim myTimer as New System.Timers.Timer()
myTimer.Enabled = true
myTimer.Interval = 2000
AddHandler myTimer.Elapsed, AddressOf myTimer_Elapsed
End Sub

Sub myTimer_Elapsed(ByVal sender As Object, ByVal e as ElapsedEventArgs)
txtSamay.Text = Now()
End Sub
</script>

<html>
<head></head>
<body>

<form runat="server">
<asp:Label ID="Label_1" runat="server"></asp:Label><BR>
<asp:Textbox ID="txtSamay" runat="server"></asp:Textbox>
</form>
</body>
</html>
 
I

Ing. Rajesh Kumar

Hi
I am sorry but I did not understand what do you mean.
Can you explain ? All the code is already posted in the group.
Thanks
Raja
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message what's the deal with posting this all over the internet?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi Everybody
I want to create a timer event on my web page. Something equivalent to setTimeOut in JavaScript. I read the MSDN but still cannot make one :

I tried the following but nothing happens. Can someone tell me what i am missing ? :
<%@ Page Language="vb" %>
<%@Import NameSpace="System.Timers" %>

<script runat="server">
Sub Page_Load(Sender As Object, e As EventArgs)
txtSamay.Text = Now()
StartTimer()
End Sub

Sub StartTimer()
Dim myTimer as New System.Timers.Timer()
myTimer.Enabled = true
myTimer.Interval = 2000
AddHandler myTimer.Elapsed, AddressOf myTimer_Elapsed
End Sub

Sub myTimer_Elapsed(ByVal sender As Object, ByVal e as ElapsedEventArgs)
txtSamay.Text = Now()
End Sub
</script>

<html>
<head></head>
<body>

<form runat="server">
<asp:Label ID="Label_1" runat="server"></asp:Label><BR>
<asp:Textbox ID="txtSamay" runat="server"></asp:Textbox>
</form>
</body>
</html>
 
I

Ing. Rajesh Kumar

Hi
I am sorry but I did not understand what do you mean.
Can you explain ? All the code is already posted in the group.
Thanks
Raja
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message what's the deal with posting this all over the internet?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi Everybody
I want to create a timer event on my web page. Something equivalent to setTimeOut in JavaScript. I read the MSDN but still cannot make one :

I tried the following but nothing happens. Can someone tell me what i am missing ? :
<%@ Page Language="vb" %>
<%@Import NameSpace="System.Timers" %>

<script runat="server">
Sub Page_Load(Sender As Object, e As EventArgs)
txtSamay.Text = Now()
StartTimer()
End Sub

Sub StartTimer()
Dim myTimer as New System.Timers.Timer()
myTimer.Enabled = true
myTimer.Interval = 2000
AddHandler myTimer.Elapsed, AddressOf myTimer_Elapsed
End Sub

Sub myTimer_Elapsed(ByVal sender As Object, ByVal e as ElapsedEventArgs)
txtSamay.Text = Now()
End Sub
</script>

<html>
<head></head>
<body>

<form runat="server">
<asp:Label ID="Label_1" runat="server"></asp:Label><BR>
<asp:Textbox ID="txtSamay" runat="server"></asp:Textbox>
</form>
</body>
</html>
 
A

Alvin Bruney [MVP]

you only need to post to one newsgroup. You've posted this thread to

microsoft.public.certification.visualstudio,
microsoft.public.dotnet.framework.aspnet,
microsoft.public.in.aspdotnet,
microsoft.public.in.dotnet,
microsoft.public.in.dotnet.framework,
microsoft.public.in.vbdotnet

Firstly it is bad manners.
Secondly, the threads aren't consolidated so that when you search for a solution you get many different threads which makes finding an answer a lot more time consuming than it should be. Trust me, if you post it to one newsgroup, it will be seen. The experts in here monitor several different newsgroups at a time which is why it pisses people off to see the same thing in multiple newsgroups. Please see the micrsoft guidelines for posting to online newsgroups if you care to find out more.


--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi
I am sorry but I did not understand what do you mean.
Can you explain ? All the code is already posted in the group.
Thanks
Raja
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message what's the deal with posting this all over the internet?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi Everybody
I want to create a timer event on my web page. Something equivalent to setTimeOut in JavaScript. I read the MSDN but still cannot make one :

I tried the following but nothing happens. Can someone tell me what i am missing ? :
<%@ Page Language="vb" %>
<%@Import NameSpace="System.Timers" %>

<script runat="server">
Sub Page_Load(Sender As Object, e As EventArgs)
txtSamay.Text = Now()
StartTimer()
End Sub

Sub StartTimer()
Dim myTimer as New System.Timers.Timer()
myTimer.Enabled = true
myTimer.Interval = 2000
AddHandler myTimer.Elapsed, AddressOf myTimer_Elapsed
End Sub

Sub myTimer_Elapsed(ByVal sender As Object, ByVal e as ElapsedEventArgs)
txtSamay.Text = Now()
End Sub
</script>

<html>
<head></head>
<body>

<form runat="server">
<asp:Label ID="Label_1" runat="server"></asp:Label><BR>
<asp:Textbox ID="txtSamay" runat="server"></asp:Textbox>
</form>
</body>
</html>
 
J

Janaka Wijayakoon

Hi all,

I have the same problem Whats the solution.......Please......?

Regards

Janaka
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message you only need to post to one newsgroup. You've posted this thread to

microsoft.public.certification.visualstudio,
microsoft.public.dotnet.framework.aspnet,
microsoft.public.in.aspdotnet,
microsoft.public.in.dotnet,
microsoft.public.in.dotnet.framework,
microsoft.public.in.vbdotnet

Firstly it is bad manners.
Secondly, the threads aren't consolidated so that when you search for a solution you get many different threads which makes finding an answer a lot more time consuming than it should be. Trust me, if you post it to one newsgroup, it will be seen. The experts in here monitor several different newsgroups at a time which is why it pisses people off to see the same thing in multiple newsgroups. Please see the micrsoft guidelines for posting to online newsgroups if you care to find out more.


--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi
I am sorry but I did not understand what do you mean.
Can you explain ? All the code is already posted in the group.
Thanks
Raja
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message what's the deal with posting this all over the internet?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi Everybody
I want to create a timer event on my web page. Something equivalent to setTimeOut in JavaScript. I read the MSDN but still cannot make one :

I tried the following but nothing happens. Can someone tell me what i am missing ? :
<%@ Page Language="vb" %>
<%@Import NameSpace="System.Timers" %>

<script runat="server">
Sub Page_Load(Sender As Object, e As EventArgs)
txtSamay.Text = Now()
StartTimer()
End Sub

Sub StartTimer()
Dim myTimer as New System.Timers.Timer()
myTimer.Enabled = true
myTimer.Interval = 2000
AddHandler myTimer.Elapsed, AddressOf myTimer_Elapsed
End Sub

Sub myTimer_Elapsed(ByVal sender As Object, ByVal e as ElapsedEventArgs)
txtSamay.Text = Now()
End Sub
</script>

<html>
<head></head>
<body>

<form runat="server">
<asp:Label ID="Label_1" runat="server"></asp:Label><BR>
<asp:Textbox ID="txtSamay" runat="server"></asp:Textbox>
</form>
</body>
</html>
 
J

Janaka Wijayakoon

oops sorry I have reply to the wrong group.....
Hi all,

I have the same problem Whats the solution.......Please......?

Regards

Janaka
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message you only need to post to one newsgroup. You've posted this thread to

microsoft.public.certification.visualstudio,
microsoft.public.dotnet.framework.aspnet,
microsoft.public.in.aspdotnet,
microsoft.public.in.dotnet,
microsoft.public.in.dotnet.framework,
microsoft.public.in.vbdotnet

Firstly it is bad manners.
Secondly, the threads aren't consolidated so that when you search for a solution you get many different threads which makes finding an answer a lot more time consuming than it should be. Trust me, if you post it to one newsgroup, it will be seen. The experts in here monitor several different newsgroups at a time which is why it pisses people off to see the same thing in multiple newsgroups. Please see the micrsoft guidelines for posting to online newsgroups if you care to find out more.


--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi
I am sorry but I did not understand what do you mean.
Can you explain ? All the code is already posted in the group.
Thanks
Raja
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message what's the deal with posting this all over the internet?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi Everybody
I want to create a timer event on my web page. Something equivalent to setTimeOut in JavaScript. I read the MSDN but still cannot make one :

I tried the following but nothing happens. Can someone tell me what i am missing ? :
<%@ Page Language="vb" %>
<%@Import NameSpace="System.Timers" %>

<script runat="server">
Sub Page_Load(Sender As Object, e As EventArgs)
txtSamay.Text = Now()
StartTimer()
End Sub

Sub StartTimer()
Dim myTimer as New System.Timers.Timer()
myTimer.Enabled = true
myTimer.Interval = 2000
AddHandler myTimer.Elapsed, AddressOf myTimer_Elapsed
End Sub

Sub myTimer_Elapsed(ByVal sender As Object, ByVal e as ElapsedEventArgs)
txtSamay.Text = Now()
End Sub
</script>

<html>
<head></head>
<body>

<form runat="server">
<asp:Label ID="Label_1" runat="server"></asp:Label><BR>
<asp:Textbox ID="txtSamay" runat="server"></asp:Textbox>
</form>
</body>
</html>
 

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

Staff online

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top