Code below will fail because the RadAjaxManager won't be found (RadAjaxManager.GetCurrent returns null). The handler won't be added. However when I place the RadScriptManager component on the form in stead of creating it in the Code behind everything runs fine. (The RadAjaxManager is placed on the form)
How can I make it in such a way that it will also work when creating the RadScriptManager in the codebehind
How can I make it in such a way that it will also work when creating the RadScriptManager in the codebehind
| Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
| Dim _ScriptManager As RadScriptManager |
| _ScriptManager = New RadScriptManager |
| _ScriptManager.ID = "ScriptManager" |
| _ScriptManager.EnablePageMethods = True |
| Form.Controls.AddAt(0, _ScriptManager) |
| If RadAjaxManager.GetCurrent(Me.Page) IsNot Nothing Then |
| AddHandler RadAjaxManager.GetCurrent(Me.Page).AjaxRequest, AddressOf HandledRadAjaxRequest |
| End If |
| End Sub |