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

Error using RadEditor with ASP.NET 4 WebForms routing

4 Answers 169 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Paul Taylor
Top achievements
Rank 1
Paul Taylor asked on 01 Jan 2011, 02:10 PM
I am using the RadEditor in the admin section of an application that uses ASP.NET 4 routing. I am having some problems getting the editor to work correctly with the routes. I have made some progress resolving the problems following the instructions in this blog post: http://www.scottfindlater.co.uk/blog/net-4-routing-and-telerik-editor-dialogue-handlers, however, I still get the following error when I attempt to access any of the resource manager dialogues (eg ImageManager). Please can you tell me what is causing the problem and how to solve it. Details of Editor implementation below the error trace.

Exception Trace
[TypeAccessException: Attempt by method 'DynamicClass.lambda_method(System.Runtime.CompilerServices.Closure)' to access type 'Telerik.Web.UI.GridDataTableFromEnumerable+GridGenericEnumerable`1<System.Data.DataRowView>' failed.]
lambda_method(Closure ) +22
System.Linq.EnumerableExecutor`1.Execute() +94
System.Linq.EnumerableExecutor`1.ExecuteBoxed() +23
System.Linq.EnumerableQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +94
Telerik.Web.UI.GridDynamicQueryable.Count(IQueryable source) +143
Telerik.Web.UI.GridDataTableFromEnumerable.FillData35() +216
Telerik.Web.UI.GridDataTableFromEnumerable.FillData() +758
Telerik.Web.UI.GridResolveEnumerable.Initialize() +35
Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized() +24
Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, DataView dataView, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +203
Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +76
Telerik.Web.UI.GridDataSourceHelper.GetResolvedDataSource(GridTableView owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +98
Telerik.Web.UI.GridTableView.get_ResolvedDataSource() +151
Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +33
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +66
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +128
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
Telerik.Web.UI.GridTableView.PerformSelect() +4
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
Telerik.Web.UI.GridTableView.DataBind() +259
Telerik.Web.UI.RadGrid.DataBind() +87
Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +2342
Telerik.Web.UI.RadGrid.OnLoad(EventArgs e) +132
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146

RadGrid use in page:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

        <telerik:RadEditor ID="editContent" runat="server">
        </telerik:RadEditor>

Skin file:
<telerik:RadEditor runat="server" Width="100%" DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.aspx" />

Programatic configuration of editor in codebehind:

        Private Sub SetupPage()
            editContent.MediaManager.ViewPaths = New String() {Config.MediaDirectory}
            editContent.MediaManager.UploadPaths = New String() {Config.MediaDirectory}
            editContent.MediaManager.DeletePaths = New String() {Config.MediaDirectory}
            editContent.ImageManager.ViewPaths = New String() {Config.ImageDirectory}
            editContent.ImageManager.UploadPaths = New String() {Config.ImageDirectory}
            editContent.ImageManager.DeletePaths = New String() {Config.ImageDirectory}
            editContent.FlashManager.ViewPaths = New String() {Config.FlashDirectory}
            editContent.FlashManager.UploadPaths = New String() {Config.FlashDirectory}
            editContent.FlashManager.DeletePaths = New String() {Config.FlashDirectory}
            editContent.DocumentManager.ViewPaths = New String() {Config.DownloadDirectory}
            editContent.DocumentManager.UploadPaths = New String() {Config.DownloadDirectory}
            editContent.DocumentManager.DeletePaths = New String() {Config.DownloadDirectory}
            Dim templateDirectory As String = String.Format("{0}/Editor", Config.TemplateDirectory)
            editContent.TemplateManager.ViewPaths = New String() {templateDirectory}
            editContent.TemplateManager.UploadPaths = New String() {templateDirectory}
            editContent.TemplateManager.DeletePaths = New String() {templateDirectory}
        End Sub

4 Answers, 1 is accepted

Sort by
0
Paul Taylor
Top achievements
Rank 1
answered on 03 Jan 2011, 01:39 PM
By the way, the version of RADControls I'm using is Telerik.Web.UI_2010_3_1215
0
Paul Taylor
Top achievements
Rank 1
answered on 04 Jan 2011, 07:08 PM
Hello,

Any ideas on this please?

Paul Taylor
0
Dobromir
Telerik team
answered on 05 Jan 2011, 05:42 PM
Hi Paul,

I already answered your support ticket on the subject. For convenience I will paste my answer here as well:

We are not aware of such problem and you are the first one to report it. I tried to reproduce the error with the ImageManager locally but to no avail.

Could you please provide a simple runnable project reproducing the problem,so we will can debug the project and provide you with more to-the-point answer?


Best wishes,
Dobromir
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Paul Taylor
Top achievements
Rank 1
answered on 05 Jan 2011, 11:15 PM
Thanks for the reply.

It turns out the error happens as a result of a customised MediumTrust security policy file used by a hosting provider I use. If I switch to the default Medium trust policy, it works OK. That's good enough for me. I haven't compared the files to see what the difference is, but if you're interested to do so, let me know and I'll send you a copy.

Regards,

Paul Taylor
Tags
Editor
Asked by
Paul Taylor
Top achievements
Rank 1
Answers by
Paul Taylor
Top achievements
Rank 1
Dobromir
Telerik team
Share this question
or