Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Fri, 27 Jun 2008 09:03:03 -0700,    group: microsoft.public.dotnet.framework.aspnet.webservices        back       


fire a method or event every hour automatically?   
Hi there,

I am new in web services and I am not sure it's related to web services. 
Is it possible a web application automatically fire a method or event every 
hour?

It shouldn't be depend on aspx pages. 

Regards,
Monica.
date: Fri, 27 Jun 2008 09:03:03 -0700   author:   Monica

Re: fire a method or event every hour automatically?   
It would really be my last resort. My personal preference is to avoid doing 
this in a web application that doesn't use this model by nature.

You may want to elaborate on your needs but if this is on a server thjat you 
control you could use the task schedular, a windows service etc...


"Monica"  a écrit dans le message de 
groupe de discussion : CCD768E7-14C4-42A2-9D58-5BD67D26CAE2@microsoft.com...
> Hi there,
>
> I am new in web services and I am not sure it's related to web services.
> Is it possible a web application automatically fire a method or event 
> every
> hour?
>
> It shouldn't be depend on aspx pages.
>
> Regards,
> Monica.
date: Fri, 27 Jun 2008 18:26:15 +0200   author:   Patrice http://www.chez.com/scribe/

Re: fire a method or event every hour automatically?   
On Jun 27, 10:03 pm, Monica  wrote:
> Hi there,
>
> I am new in web services and I am not sure it's related to web services.
> Is it possible a web application automatically fire a method or event every
> hour?
>
> It shouldn't be depend on aspx pages.
>
> Regards,
> Monica.

Hey Monica

If Windows Service if forbidden on your side, you can still do it
hopefully by a trick.

ASP.NET Worker process frequently looks for Cache items whether they
expired. You can harness this feature. On Application_Start inside
global.asax, add a dummy cache item using
HttpContext.Current.Cache.Add. In the method signature you will see
the last item is System.Web.Caching.CacheItemRemovedCallback which is
a delegate that gets fired upon expiration of this cache item.

When it is fired, the code you specified in the handler gets executed
and again add the dummy cache item you inserted before. That will do
the trick. It can be like the following:

HttpContext.Current.Cache.Add(dummyKey, "dummy", null,
DateTime.MaxValue, TimeSpan.FromMinutes(60), CacheItemPriority.Normal,
new CacheItemRemovedCallback(CacheItemRemovedCallback));

...

public void CacheItemRemovedCallback(string key, object value,
CacheItemRemovedReason reason)
{
     // Code you would like to get executed.
     // Add the dummy item to the Cache like above.
}

Hope it helps.

Tanzim Saqib
http://www.TanzimSaqib.com
date: Tue, 1 Jul 2008 06:38:11 -0700 (PDT)   author:   Tanzim Saqib

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us