ASP.NET Timer control

I've uploaded my ASP.NET Timer control to GotDotNet User Samples today.  Here's the blurb about what it is and why you might need it:

Provides a mechanism for generating recurring events at specified intervals. This can be useful if you have something like a hidden frame that needs to be refreshed at specific intervals or a hidden frame that is used to poll a server.

I probably should've called it ServerPoll or something like that.  One of the neat features of this control is that it also exposes on the client to notify about it's current state.

http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=69a7c7bb-939a-4777-aceb-2d9ebbe35b85

33 Comments

  • I was wondering if you had a small example of using this control you could post for download?



    THanks

  • There's quite a bit of sample code in the .chm file that comes with the Assembly have you seen that?

  • Sorry I should have looked deeper before asking. I see it know. Thanks for the quick response.



  • No probs.... let me know if you get stuck :-)

  • I think you've a css problem or something...I'm viewing (most of) your page in IE 6.0.2800 and the content for the frame is too far to the left and is under the left hand side links pane

  • Code behind adjustment:



    change protected virtual void RegisterClientScript() to

    public virtual void RegisterClientScript()



    and in your script just RegisterClientScript();



    protected MarkItUp.WebControls.Timer Refresh_Sessions;



    #region Web Form Designer generated code

    override protected void OnInit(EventArgs e)

    {

    //

    // CODEGEN: This call is required by the ASP.NET Web Form Designer.

    //

    InitializeComponent();

    base.OnInit(e);

    }



    /// <summary>

    /// Required method for Designer support - do not modify

    /// the contents of this method with the code editor.

    /// </summary>

    private void InitializeComponent() {

    this.Refresh_Sessions.RegisterClientScript();

    etc...

  • Hello everyone,



    I am trying to build an application in asp.net where after the user logs into the system, exactly after two hours they will be logoff automatically. I know that I have to use a timer to track the time, but i dont know how to use one in asp.net. I even try to download the asp.net timer from GOT DOT NET but could not download it. Please guys, if you have any suggestions/comments, please let me know.



    Thank you

  • I'm seeing a memory leak also. I used the timer control inside a new web control which needs to be refreshed at specific intervals and even in the IDE I'm seeing memory leaks while the control is displayed in design mode. It appears to be from 4k to 6k at each refresh as Bing mentioned in a post on 2/20/2004.

  • Thanks Randy, I've been a bit busy of late. Leave it with me and I'll fix it in the next week or so. I'll blog about it when it's fixed and post it against my "Tools" category.



    Thanks for the feedback!

  • How do I get the timer to automatically fire off the MyTimer_Elapsed function? I have implemented a VB.Net codebehind.



    What special needs to be done besides importing the reference into the codebehind and then adding the MyTimer_Elapsed Sub?



    Thanks

  • Drew,



    You are using code behind right?



    In the codebehind module just declare the Timer using the WithEvents modifier:



    Protected WithEvents myTimer as MarkItUp.WebControls.Timer



    Then, when you declare your MyTimer_Enable handler, you simply add the Handles clause to instruct it to wire-up the delegates:



    Protected Sub MyTimer_Enable( ... ) Handles myTimer.Elapsed





    Hope this helps.

  • Randy and Bing, I'm sorry but in all of my tests I have been unable to reproduce the behaviour which you have described. Can you possibly send me an example (and some instructions) which reproduce this effect?



    Email to: showusyourcode@hotmail.com



    Thanks!

  • Hi all,



    I´m trying to do exactly the same thing... I need a timer to refresh some Iframes at my page, after few seconds.



    The sample you post have this error : The sample requested is not available.



    :-(



    Please, could you send me an example too ?



    Thx



    -=-

    Scare_Crow

    BRazil

  • Sorry, I forget my email



    mcid@brturbo.com





    >Hi all,



    >I´m trying to do exactly the same thing... I need a timer to refresh some Iframes at my page, after few seconds.



    >The sample you post have this error : The sample requested is not available.



    >:-(



    >Please, could you send me an example too ?



    >Thx



    >-=-

    >Scare_Crow

    >BRazil

  • Hi, I'm searching for an asp.net timer similar to the javascript countdown timers. I found this timer control, but I don't know if I can code it do what I'm looking for (small countdown timer in upper corner of screen to let the user know how much time is left on the test). If anyone knows if this can be accomplished in asp.net I would greatly appreciate it! (I have several javascript versions, this is more for curiosity's sake)



    Creon Noir

  • i need a timer that counts down time from a specified min to 0 using visual basic.net

  • how to dispaly clock in asp.net by using timer component.

  • How use timer in asp.net?

  • A 4 year-old post is still alive, not bad

    just to let you guys know there's an ASP.NET AJAX control called timer, google for it.

  • i want to apply timer control in asp.net because I want to up the database automatically on to server .

  • i need a code in c# for applying timer to datalist and also in displaying error messages for a short time.

  • Please help to use adrtator in asp.net with continuous show of three images

  • i want to use timer in asp.net webapplication ,while writing the online exam after time gets over it should indicate

  • i want to use timer in asp.net webapplication ,while writing the online exam after time gets over it should indicate

  • Pls anyone can tell me how to use timer in asp.net

  • im doing project on online examination and i dnt knw how can i set timer in asp.net..

    plzzz anyone help me..........

  • Can any one please tell me how to use Timer in ASP,C#.Net ?

  • 7hT5nO Thanks-a-mundo for the post.

  • Muchos Gracias for your article.Really looking forward to read more. Really Great.

  • Really informative blog article.Really looking forward to read more. Great.

  • wow, awesome blog article.Much thanks again. Will read on...

  • Thanks for sharing, this is a fantastic post.Thanks Again. Keep writing.

  • Major thankies for the blog post. Want more.

Comments have been disabled for this content.