RadAjax for ASP.NET AJAX

RadControls for ASP.NET AJAX

There are some cases where you might need to create the RadAjaxManager control programmatically. This is an easy task, however note this should be done in the Page_Init event but later. Below is a sample code you can use:

Then, to access the RadAjaxManager instance you can call the GetCurrent() static method of the RadAjaxManager class:

Server-Side

CopyJavaScript
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function GetAjaxManager() {
            var manager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>")
        }
    </script>
</telerik:RadCodeBlock>

Additionally, note that if you are creating the ScriptManager dynamically as well, you should add it to the Page.Form.Controls collection before the RadAjaxManager control.