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

Ajaxify Timer and Loading User Control

1 Answer 64 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Noel Tam
Top achievements
Rank 1
Noel Tam asked on 15 Mar 2012, 05:56 PM
Dear All

I would like add a timer control to loop the different user control periodicity. I follow the Telerik Ajax Sample successful do that. In my user control, I have some Jquery/Javascripts would like to run. 

I try to add function pageLoad() in my user control, but still can't run. How can I do that? Thanks

default.aspx.vb
Protected Sub Timer1_Tick(sender As Object, e As System.EventArgs) Handles Timer1.Tick
        If LatestLoadedControlName = "uc1.ascx" Then
            Me.Timer1.Interval = 15000
            LoadUserControl("uc2.ascx")
        Else
            LoadUserControl("uc1.ascx")
        End If
End Sub

uc1.ascx
<script type="text/javascript">
    function pageLoad() {
        alert("test");
    }
</script>

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 20 Mar 2012, 01:56 PM
Hello Noel,

In a correctly working scenario, the pageLoad event is expected to fire. Can you confirm whether the OnResponseEnd client event of the RadAjaxManager/Panel fires in this context? You could use it to run your custom logic as well. If this does not work too, confirm that you do not get any client script errors.

Regards,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Ajax
Asked by
Noel Tam
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or