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

[Solved] Filtering RadGrid without Full Trust

8 Answers 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 23 Apr 2009, 08:20 PM
When deployed to our corporate .NET hosting environment, my application fails when filtering a grid...

-----------------

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
---------------------

I'm guessing the corporate environment runs in medium trust but I have an email in to the site admin to find out for sure.  It works OK in my local environment.  Only filtering has a problem.  All other functionality on the rad grid and other telerik controls I use are fine.  Is there a way to make this work without full trust?

Thanks

8 Answers, 1 is accepted

Sort by
0
Matt
Top achievements
Rank 1
answered on 24 Apr 2009, 02:46 PM
On my local machine, ReflectionPermission is allowed in medium trust, but if I remove this line from the medium trust config file, I can duplicate the error I get on the corporate server.  Is there anyway I can filter without needing the ReflectionPermission?

Thanks
0
Sebastian
Telerik team
answered on 27 Apr 2009, 01:34 PM
Hello Matt,

Can you please check whether this issue appears with the official hotfix 2009.1.402 of RadControls for ASP.NET AJAX (Q1 2009 SP1) or the latest internal build of the suite? Generally speaking, our controls can operate under medium trust or on shared hosting as explained here.

Best regards,
Sebastian
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
Matt
Top achievements
Rank 1
answered on 27 Apr 2009, 07:52 PM

I have now installed and am running 2009.1.402.35 (I previously had been using 2008.1.415.35) but I still get the same error.

 

0
Sebastian
Telerik team
answered on 28 Apr 2009, 07:32 AM
Hi Matt,

Have you tested the latest internal build as well? In case the problem under medium trust persists with it, please isolate a stripped working version of your project and send it enclosed to a regular support ticket. We will test/debug it locally and will get back to you with more info on the subject.

Regards,
Sebastian
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
ELLIS-NORWOOD SHAUNT
Top achievements
Rank 1
answered on 28 Apr 2009, 01:42 PM

I've also tested with the latest internal build 2009.1.428.35 and get the same result.  I've created a stripped down project that only has a webform and a user control with a grid on it.  I'm trying enter a support ticket but get an error when I click the "Support Ticket" link.  I'll keep trying.

 

 

0
ELLIS-NORWOOD SHAUNT
Top achievements
Rank 1
answered on 28 Apr 2009, 01:49 PM
(Note:  I'm posting now using our account to which the licenses are registered)

Here's my code until I can enter a support ticket:


WebUserControl1.aspx:

 

<%

@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="WebApplication4.WebUserControl1" %>

 

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

<

 

telerik:RadScriptManager ID="RadScriptManager1" Runat="server">

 

</

 

telerik:RadScriptManager>

 

<

 

telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"

 

 

DataSourceID="SqlDataSource1" GridLines="None">

 

<

 

MasterTableView DataSourceID="SqlDataSource1">

 

<

 

RowIndicatorColumn Visible="False">

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

RowIndicatorColumn>

 

<

 

ExpandCollapseColumn Visible="False" Resizable="False">

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

ExpandCollapseColumn>

 

<

 

EditFormSettings>

 

<

 

PopUpSettings ScrollBars="None"></PopUpSettings>

 

</

 

EditFormSettings>

 

</

 

MasterTableView>

 

</

 

telerik:RadGrid>

 

<

 

asp:SqlDataSource ID="SqlDataSource1" runat="server"

 

 

ConnectionString="<%$ ConnectionStrings:RatConnectionString %>"

 

 

SelectCommand="SELECT * FROM [RAT_OWNER].[Project]"></asp:SqlDataSource>


Default.aspx

 

<%

@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication4._Default" %>

 

<%

@ Register src="WebUserControl1.ascx" tagname="WebUserControl1" tagprefix="uc1" %>

 

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<

 

html xmlns="http://www.w3.org/1999/xhtml" >

 

<

 

head runat="server">

 

 

<title>Untitled Page</title>

 

</

 

head>

 

<

 

body>

 

 

<form id="form1" runat="server">

 

 

<div>

 

 

 

<uc1:WebUserControl1 ID="WebUserControl11" runat="server" />

 

 

 

</div>

 

 

</form>

 

</

 

body>

 

</

 

html>

 

0
Pavel
Telerik team
answered on 30 Apr 2009, 07:00 AM
Hello Matt,

I have prepared a small sample which works as expected on my end under Medium trust level. Can you try it and let me know if it works for you as well?

Kind regards,
Pavel
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
Matt
Top achievements
Rank 1
answered on 01 May 2009, 02:42 PM
I have not been able to get this example to work yet.  I've worked thru some of the issues but stopped on:

Unable to cast object of type 'System.Web.Configuration.ScriptingProfileServiceSection' to type 'System.Web.Configuration.ScriptingProfileServiceSection'.



On the plus side our corporate infrastructure group has granted my application to access to reflectionpermission so my problem kindof went away.
Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Answers by
Matt
Top achievements
Rank 1
Sebastian
Telerik team
ELLIS-NORWOOD SHAUNT
Top achievements
Rank 1
Pavel
Telerik team
Share this question
or