Hi there!
I'm adding ScriptManager as dynamical like this.
And I get this error
I'm also using a handler to get cache and nicer url without querys. It's more code behind here...
In the web.config it looks like this
Do I need to use RadScriptManager? Something gets wrong when I add the context back. Any ideas here?
/Thanks
I'm adding ScriptManager as dynamical like this.
| Protected Overloads Overrides Sub OnPreInit(ByVal e As EventArgs) |
| Dim myScriptManager As ScriptManager = ScriptManager.GetCurrent(Me) |
| If myScriptManager Is Nothing Then |
| myScriptManager = New ScriptManager() |
| myScriptManager.ID = "ScriptManager1" |
| Dim myControl As Control = Me.FindControl("Form1") |
| If myControl IsNot Nothing Then |
| myControl.Controls.AddAt(0, myScriptManager) |
| End If |
| End If |
| MyBase.OnPreInit(e) |
| End Sub |
And I get this error
| System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.InvalidOperationException: The control with ID 'R1t' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it. |
| at Telerik.Web.UI.ScriptRegistrar.GetScriptManager(Control control) |
| at Telerik.Web.UI.RadDataBoundControl.get_ScriptManager() |
| at Telerik.Web.UI.RadDataBoundControl.RegisterScriptControl() |
| at Telerik.Web.UI.RadDataBoundControl.OnPreRender(EventArgs e) |
| at System.Web.UI.Control.PreRenderRecursiveInternal() |
| at System.Web.UI.Control.PreRenderRecursiveInternal() |
| at System.Web.UI.Control.PreRenderRecursiveInternal() |
| at System.Web.UI.Control.PreRenderRecursiveInternal() |
| at System.Web.UI.Control.PreRenderRecursiveInternal() |
| at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) |
| --- End of inner exception stack trace --- |
| at System.Web.UI.Page.HandleError(Exception e) |
| at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) |
| at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) |
| at System.Web.UI.Page.ProcessRequest() |
| at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) |
| at System.Web.UI.Page.ProcessRequest(HttpContext context) |
| at ASP.t2_aspx.ProcessRequest(HttpContext context) |
| at clsHttpHandler.clsHttpHandlerController.ProcessRequest(HttpContext context) in N:\Inetpub\wwwroot\TB_Server_Dev\Common Projects\clsHttpHandler\clsHttpHandlerController.vb:line 32 |
| at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() |
| at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) |
I'm also using a handler to get cache and nicer url without querys. It's more code behind here...
| Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements System.Web.IHttpHandler.ProcessRequest |
| Dim url, pathTranslated, strPath As String |
| url = context.Items("url") |
| pathTranslated = context.Items("path") |
| strPath = HandleRequest(context, url, pathTranslated) |
| context.Handler = PageParser.GetCompiledPageInstance(url, strPath, context) |
| context.Handler.ProcessRequest(context) |
| End Sub |
In the web.config it looks like this
| <httpHandlers> |
| <remove verb="*" path="*.asmx"/> |
| <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
| <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
| <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
| <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" /> |
| <add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler, Telerik.Web.UI"/> |
| <add verb="*" path="tbimage.aspx" type="RenderUtils.HttpImageHandler, RenderUtils"/> |
| <add verb="*" path="*.aspx" type="clsHttpHandler.HttpXmlHandler, clsHttpHandler"/> |
| </httpHandlers> |
Do I need to use RadScriptManager? Something gets wrong when I add the context back. Any ideas here?
/Thanks