Ajaxmanager and ASP:Timer

2 posts, 1 answers
  1. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 10 Jul 2008 Link to this post

    I have a timer and try to update a label ontick using ajaxmanager

    <telerik:AjaxSetting AjaxControlID="TimerUpdate">

    <UpdatedControls>

    <telerik:AjaxUpdatedControl ControlID="TimerUpdate"/>

    <telerik:AjaxUpdatedControl ControlID="LblWatchList"/>

    </UpdatedControls>

    </telerik:AjaxSetting>

    It gives me, The method or operation is not implemented. 
    [NotImplementedException: The method or operation is not implemented.]
       System.Web.UI.Timer.set_Visible(Boolean value) +54

    it seems like RADAjaxmanager is trying to set visiability of a control regardless it has a visiable property or not, and it through an exception.

    do i have to put them into RADAjaxPanel? thanx

  2. Answer
    Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 11 Jul 2008 Link to this post

    Hi James,

    Indeed, the ASP:Timer's Visible setter is not implemented. The simplest solution is to wrap the timer into an always visible parent and update it instead. Find below a sample code:

    <%@ Page Language="C#" %> 
     
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    <script runat="server"
     
        protected void Timer1_Tick(object sender, EventArgs e) 
        { 
            Label1.Text = (Int32.Parse(Label1.Text) + 1).ToString(); 
        } 
    </script> 
     
    <html xmlns="http://www.w3.org/1999/xhtml" > 
    <head runat="server"
        <title>Untitled Page</title> 
    </head> 
    <body> 
        <form id="form1" runat="server"
            <asp:ScriptManager ID="ScriptManager1" runat="server"
            </asp:ScriptManager> 
        <div> 
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="Timer1"
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="Panel1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
            <asp:Panel ID="Panel1" runat="server"
                <asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick" Interval="1000"></asp:Timer> 
                <asp:Label ID="Label1" runat="server" Text="0"></asp:Label> 
            </asp:Panel> 
        </div> 
        </form> 
    </body> 
    </html> 
     


    All the best,
    Konstantin Petkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top