locked
How to call a particular URL Periodically ? RRS feed

  • Question

  • User750184344 posted
    Dear Friends, I want to call a particular URL periodically. For Example, I have written something in my WebForm1.ASPX ofwhich URL is http://MyApplication/WebForm1.ASPX. Now when i access this URL, i have written some code in page_Load so it will fire automatically. But Now i want that this URL should be called at every half an hour time from somewhere so that every half an hout its Page_Load will be called and that code will be executed written in it without physically calling it from Internet Explorer. I dont want to go to Internet Explorer and write this URL and call it explicitely. So is this possible using ASP.NET ? Pls help me to solve this. Thanks in Advance Nirav
    Thursday, July 15, 2004 8:38 AM

All replies

  • User-1391363652 posted
    Nirav, "From somewhere else", I assume, is some web code. Rob Howard gave a talk at TechEd 2004. Check out slides and demo code. One of the samples demostrates how to set up a database cache dependency. Rob showed how to set up a TimerCallback for this purpose. See the HttpModule.cs file.
    Monday, July 19, 2004 11:20 AM
  • User1651711768 posted
    Nirav, It seems from the requirement you posted that there is nothing on the page to be displayed on Client's computer, in this case, ideally, you should write a Windows Service running on Web Server to execute your code from within the service rather than polling a page on certain interval just to execute code written in Page's Load Event. Within the Service, as Milan suggested, you still need to use TimerCallback to periodically call certain method. Again in your case you don't want to go to IE, in this case you still need to write some code that can poll your page from web server itself, for that you still need to write either a Windows Service to poll the page. There are other alternate to Windows Service, however, Windows Service is more suitable on the Web Server over those alternates.
    Saturday, July 24, 2004 10:31 PM
  • User1970795084 posted
    I think the problem is being over-complicated?? If you mean you want to automatically refresh the web page every 1/2 hour without the user doing anything then all you would need is a meta tag in the html head of your web form, like this: <meta http-equiv="refresh" content="1800"> If I am way off the mark here, then I suggest thinking about converting your code into a simple windows application and running it as a scheduled task.
    Friday, July 30, 2004 12:42 PM