This is a migrated thread and some comments may be shown as answers.

Ajaxmanager and ASP:Timer

1 Answer 271 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
James Shelton Agar
Top achievements
Rank 2
James Shelton Agar asked on 11 Jul 2008, 02:47 AM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Konstantin Petkov
Telerik team
answered on 11 Jul 2008, 06:34 AM
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
Tags
Ajax
Asked by
James Shelton Agar
Top achievements
Rank 2
Answers by
Konstantin Petkov
Telerik team
Share this question
or