Can I trigger a function in asp.net?
-
-
timer control will sort this problem out.
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
-
timer control will sort this problem out.
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
Pankaj Garg wrote:
timer control will sort this problem out.
Sure and use eventhandler and Deleget that function on Timer_Tick
Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"
-
timer control will sort this problem out.
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
I think the timer control won't work. The timer works only the page which contains the times runs. Thanks Hogan
-
I think the timer control won't work. The timer works only the page which contains the times runs. Thanks Hogan
hogan.john wrote:
The timer works only the page which contains the times runs.
can you explain in details ???
Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"
-
hogan.john wrote:
My requirment is that I want to run a function in a class automatically every 30 days
That doesn't sound like a good job for a webserver to be honest. Can't you wrap the method call and use windows scheduler, or a windows service to run the call for you?
Small angry dogs
-
hogan.john wrote:
The timer works only the page which contains the times runs.
can you explain in details ???
Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"
Sorry I am not an expert. But it is the client-server technology. I think, the executables in the bin folder only work whenever a browser requests any pages in that site. Hope I am clear now. Thanks, Hogan
-
I think the timer control won't work. The timer works only the page which contains the times runs. Thanks Hogan
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
-
hogan.john wrote:
My requirment is that I want to run a function in a class automatically every 30 days
That doesn't sound like a good job for a webserver to be honest. Can't you wrap the method call and use windows scheduler, or a windows service to run the call for you?
Small angry dogs
But how can i implement a windows service in the remote host machine? Thanks Hogan
-
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
Thanks to spend time with me Pankaj. But I am afraid that it won't work automatically Regards, Hogan
-
Pankaj Garg wrote:
timer control will sort this problem out.
Sure and use eventhandler and Deleget that function on Timer_Tick
Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"
i was using the timer control in website just for the practise purposes.I saw , the timer control is auto executing after it's time interval if it is a ajax enabled website. If it is a asp.net we site(partially enabled ajax website , i mean , in the asp.net website , i am dragging the ajax controls) then the timer control is not working , it works if in the form load i write
protected void Page_Load(object sender, EventArgs e) { Timer1_Tick(sender, e); }
the source file code<form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick"> </asp:Timer> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /> </Triggers> </asp:UpdatePanel> </form>
I am unable to understand where i am wrong ?If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
-
I am sorry for misunderstanding the requirment . I thought it was 30 min. it is 30 day !!! if you are try to use Timer ... this is a very bad approch!!! best use Windows Services as malcolm suggested...
Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"
-
But how can i implement a windows service in the remote host machine? Thanks Hogan
Can you tell me what kind of function is this or what is the object of this function ? is it database related ???
Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"
-
I am sorry for misunderstanding the requirment . I thought it was 30 min. it is 30 day !!! if you are try to use Timer ... this is a very bad approch!!! best use Windows Services as malcolm suggested...
Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"
i was using the timer control in website just for the practise purposes.I saw , the timer control is auto executing after it's time interval if it is a ajax enabled website. If it is a asp.net web site(partially enabled ajax website , i mean , in the asp.net website , i am dragging the ajax controls) then the timer control is not working , it works if in the form load i write
protected void Page_Load(object sender, EventArgs e) { Timer1_Tick(sender, e); }
the source file code<form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick"> </asp:Timer> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /> </Triggers> </asp:UpdatePanel> </form>
I am unable to understand where i am wrong ?If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
-
Can you tell me what kind of function is this or what is the object of this function ? is it database related ???
Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"
a function written in a class. Just like this... class test { public void show(){} }
modified on Tuesday, January 15, 2008 3:36:12 AM
-
i was using the timer control in website just for the practise purposes.I saw , the timer control is auto executing after it's time interval if it is a ajax enabled website. If it is a asp.net web site(partially enabled ajax website , i mean , in the asp.net website , i am dragging the ajax controls) then the timer control is not working , it works if in the form load i write
protected void Page_Load(object sender, EventArgs e) { Timer1_Tick(sender, e); }
the source file code<form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick"> </asp:Timer> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /> </Triggers> </asp:UpdatePanel> </form>
I am unable to understand where i am wrong ?If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
Pankaj Garg wrote:
protected void Page_Load(object sender, EventArgs e) { Timer1_Tick(sender, e); }
This is not the way delegate a fuction !!!! Check this one :)
protected void Page_Load(object sender, EventArgs e) { Timer1.Tick += new EventHandler<EventArgs>(Timer1_Tick); } void Timer1_Tick(object sender, EventArgs e) { Label1.Text = System.DateTime.Now.ToLongTimeString(); }
;)Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"
-
a function written in a class. Just like this... class test { public void show(){} }
modified on Tuesday, January 15, 2008 3:36:12 AM
hogan.john wrote:
a function written in a class. Just like this... class test { public void show(){} }
This is normal function !!! but i want to know why you want to execute it after 30 day . It should be special reason , then we can think a differnt apporch as per requirment :)
Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"
-
Pankaj Garg wrote:
protected void Page_Load(object sender, EventArgs e) { Timer1_Tick(sender, e); }
This is not the way delegate a fuction !!!! Check this one :)
protected void Page_Load(object sender, EventArgs e) { Timer1.Tick += new EventHandler<EventArgs>(Timer1_Tick); } void Timer1_Tick(object sender, EventArgs e) { Label1.Text = System.DateTime.Now.ToLongTimeString(); }
;)Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"
protected void Page_Load(object sender, EventArgs e) { Timer1.Tick += new EventHandler<EventArgs>(Timer1_Tick); Timer1.Enabled = true; } protected void Timer1_Tick(object sender, EventArgs e) { i += 0; Label1.Text = i.ToString(); }
I think after writing the code , the control should auto execute the timer_tick function. But the control is not comming there. the time interval is 1000.If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
-
protected void Page_Load(object sender, EventArgs e) { Timer1.Tick += new EventHandler<EventArgs>(Timer1_Tick); Timer1.Enabled = true; } protected void Timer1_Tick(object sender, EventArgs e) { i += 0; Label1.Text = i.ToString(); }
I think after writing the code , the control should auto execute the timer_tick function. But the control is not comming there. the time interval is 1000.If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
what out comes are you getting in label ??? i think only 0 .
Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"
-
hogan.john wrote:
a function written in a class. Just like this... class test { public void show(){} }
This is normal function !!! but i want to know why you want to execute it after 30 day . It should be special reason , then we can think a differnt apporch as per requirment :)
Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"
Ok :) My purpose is to send monthly new letters to every registered members at the end of the month