Hi support team ,
Server Error in '/' Application.
Exception Details:System.Security.SecurityException: Request for the permission of type'Microsoft.SharePoint.Security.SharePointPermission,Microsoft.SharePoint.Security, Version=14.0.0.0, Culture=neutral,PublicKeyToken=71e9bce111e9429c' failed.
Source Error:
I am bit new to this telerik.
I installed RadControls for ASP.NET AJAX Q1 2010 SP1 ,And i want to place a rad grid in sharepoint webpart.
this my .ascx
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" RestoreOriginalRenderDelegate="false"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="grid"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="grid" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
<telerik:RadGrid ID="grid" runat="server" BackColor="#0066FF" ForeColor="Black" al> |
</telerik:RadGrid> |
in code behind
dtCommonList = List.GetItems(QueryForSDM).GetDataTable(); |
if (dtCommonList.Rows.Count > 0) |
{ |
grid.DataSource = dtCommonList; |
grid.DataBind(); |
grid.Visible = true; |
} |
else |
{ |
Response.Write("no data"); |
} |
When i deployed thi sdeploy was successful, but when adding to page
Not enough permissions. Inherit your page class from RadAjaxPage if you are running under Medium trust level.
so i changed my package.template.xml file and add my custom CAS
<CodeAccessSecurity> |
<PolicyItem> |
<PermissionSet class="NamedPermissionSet" version="1" Description="Permission set for SouthwesternEnergy.Partners.Web."> |
<IPermission class="AspNetHostingPermission" version="1" Level="Minimal" /> |
<IPermission class="SecurityPermission" version="1" Flags="Execution,ControlPrincipal,ControlAppDomain,ControlDomainPolicy,ControlEvidence,ControlThread" /> |
<IPermission class="Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" |
version="1" ObjectModel="True" /> |
<IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="UserName" /> |
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="$AppDir$;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\CONTROLTEMPLATES\VisualWebPartProject1" Write="$AppDir$" Append="$AppDir$" PathDiscovery="$AppDir$" /> |
</PermissionSet> |
<Assemblies> |
<Assembly Name="VisualWebPartProject1" /> |
</Assemblies> |
</PolicyItem> |
</CodeAccessSecurity |
but after that i am unable to deply solution so i added a custom target file as mentioned in this site
http://support.microsoft.com/kb/2022463
but it gave me another exception this time
Server Error in '/' Application.
Security Exception
Description:The application attempted to perform an operation not allowed by thesecurity policy. To grant this application the required permission pleasecontact your system administrator or change the application's trust level in theconfiguration file.Exception Details:System.Security.SecurityException: Request for the permission of type'Microsoft.SharePoint.Security.SharePointPermission,Microsoft.SharePoint.Security, Version=14.0.0.0, Culture=neutral,PublicKeyToken=71e9bce111e9429c' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Is it possible to add radgrid into sharepoint webpart?
I added necessary dlls into bin.
and even changed assemblyinfo.cs
[assembly: AllowPartiallyTrustedCallers()] |
I just have one day left to complete this task. So kindly help to fix this issue.