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

Scriptmanager and RadMenu

4 Answers 137 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Philip Saltskog
Top achievements
Rank 2
Philip Saltskog asked on 09 Mar 2009, 04:18 PM
Hi there!

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

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 10 Mar 2009, 10:33 AM
Hi Philip Saltskog,

This error may occur if you are mixing different versions of ASP.NET Ajax and RadControls for ASP.NET Ajax e.g. ASP.NET Ajax 1.0 and RadControls for ASP.NET Ajax built for .net 3.5. Please make sure you are using the right version of the Telerik.Web.UI assembly - the version number should end with 35 (2008.3.1314.35) if you are targeting .net 3.5 and with 20 (2008.3.1314.20) when targeting .net 2.0 and ASP.NET Ajax 1.0.

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Philip Saltskog
Top achievements
Rank 2
answered on 10 Mar 2009, 02:08 PM
It is the latest version of asp.net ajax, but I've a old RadMenu.dll in the bin lib and I've deleted now.
I don't think this is a Telerik issue coz the scriptmanager will not registred so I change

<xhtmlConformance mode="Legacy"/> 
to
<xhtmlConformance mode="Transitional"/> 

and now the scriptmanager will registred on the page, but the Ajax RadMenu cant still find it!??

The Radmenu is placed in a usercontroller as will load from default.aspx inherit from basepage. In another usercontrol I've a RadTreeView and it will loaded similar.
The RadMenu get me same error, but the RadTreeView will work?

I've read about scriptmanager and som registry problem, but now can I really see the manager on each page and the menu should could pick it up?

/Thanks
0
Atanas Korchev
Telerik team
answered on 10 Mar 2009, 03:05 PM
Hello Philip Saltskog,

I cannot tell where the problem is based on your explanation. Could you please open a support ticket and send us a sample project which demonstrates the issue? It would help us troubleshoot the problem and provide a solution. Thanks.

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Philip Saltskog
Top achievements
Rank 2
answered on 10 Mar 2009, 04:03 PM
Sure, but before i will try to eliminate some .dll wich is not used here and other stuff so I have a pretty clean copy of it.

/Thanks
Tags
Ajax
Asked by
Philip Saltskog
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
Philip Saltskog
Top achievements
Rank 2
Share this question
or