C# - Integrating Dynamics CMS With Sharepoint ASCX SecurityException

Apr 9, 2010

I've an ASCX control (WebParts aren't used in this solution) which interrogates CMS 4's data via the API provided by Microsoft.Crm.Sdk and Microsoft.Crm.SdkTypeProxy.The solution works until it's deployed to Sharepoint.

Initially I received the following error:

[SecurityException: That assembly does not allow partially trusted callers.]
MyApp.SharePoint.Web.Applications.MyAppUtilities.RefreshUserFromCrm(String login) +0
MyApp.SharePoint.Web.Applications.MyApp_LoginForm.btnLogin_Click(Object sender, EventArgs e) +30
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111

Then I tried wrapping the calling code in the ASCX with SPSecurity.RunWithElevatedPrivileges:

SPSecurity.RunWithElevatedPrivileges(delegate()
{
// FBA user may not exist yet or require refreshing
MyAppUtilities.RefreshUserFromCrm(txtUser.Text);
});

But this resulted in the following error (I'm thinking RunWithElevatedPrivileges isn't for this sort of thing anyway, but someone [SecurityException: Request for the permission of type 'Microsoft.SharePoint.Security.SharePointPermission,Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' failed.

MyApp.SharePoint.Web.Applications.MyApp_LoginForm.btnLogin_Click(Object sender, EventArgs e) +0
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111

When I elevate the trust level in the Sharepoint site to full everything works fine, however I need to come up with a solution that uses minimal trust (or a customised minimal trust). I'm also trying to stay clear of adding anything to the GAC.I assume the issue is occuring when trying to call functionality from Microsoft.Crm.*

View 2 Replies


Similar Messages:

Dynamics - Run 4.0 App In The ISV Folder On CRM 4.0?

May 6, 2010

How can I run an ASP.net 4.0 app in the ISV folder on CRM 4.0? It works if I make the asp.net app target .net 2.0, but if I switch it to .net 4.0 I get 404.17's. Which imply that the script handler setting is missing from my web config, but isn't that built into the .net 4.0 runtime now? (hence it's removal from the web.config automatically). When my app was .net 2.0, I had modified the web config in the proper manner that is well documented on various sites and blogs on the net. Anyone able to get this working? (I need to use a .net 4 web control on my asp.net page)

View 2 Replies

MVC :: How To Encapsulate Logic In Ascx Partial View With The Same Efficiency Of Webforms Ascx

Aug 10, 2010

I have to build a few ascx partial views in my MVC applications to encapsulate re-usable functionalities as well as archive SOR and SOC. However, I encountered challenge how to encapsulate the business logic that drives MVC ascx views.In webforms, the code behind of an ASCX control can handle a button click event and browser still shows the same page with only one postback. How can I archive the same thing in MVC? When ~/Address/Edit/2 includes an ascx partial view with a button on it that calls another MVC action - let's say ~/ShareController/CommonAction - what is the best way for the CmmonAction to return to the very same view that includes the ascx file?Perhaps I am missing a common pattern in MVC web development?

View 5 Replies

C# - Dynamics CRM Get Info For Customer

Apr 16, 2010

I'm working on a ASP.NET (C#) site that pulls most of its data from Dynamics CRM over SOAP using Microsoft's CrmService SDK. I'm at the point where a query has returned an entity with a property of the type Customer. I need to get the name string of that customer record, but cannot figure out how to do so. By doing a little guess work I figured out that what I have is GUID for the customer. How can I use this GUID to get the customer's name as a string? Relevant Links:

CrmService Docs
Customer Property
Customer Class

View 1 Replies

Customize A Control In Dynamics Crm

Nov 2, 2010

I've written code that can make a phone dial a number from a function call, that's done and dusted. What I would like to achieve is adding a Dial button to each phone number field on the forms in Dynamics CRM. Eventually this could also create a new phone record fill in the basic details and show it to the user to enter notes and an outcome for the phone call, and perhaps some other workflow bits to schedule the next call.

Can I put a custom control on a standard form in place of the standard control. I'm assuming it would have to be an IFrame to an asp.net page, that pulls in the record id, and the field name, looks up the number to show in a text box, and passes the number to the DialNumber function. I assume its not going to be that easy... Has anyone tried this before, what's the process, what are the gotchas?

View 1 Replies

Customer Workflow For CRM Dynamics

Jul 15, 2010

I need to create a customer workflow for CRM dynamics , I have visual studio 2010 Express edition install in my machine. I most of the examples in web says Go to Visual studio 2005 or more, then slect Workflow Project type in new project dialog box. but in express edition i cannot see workflow as a project type, is this because of express edition or do i need to run any thing to get this project types in to VS express.

View 4 Replies

WCF / ASMX :: Microsoft Dynamics GP Web Services?

Jul 7, 2010

Microsoft Dynamics GP is installed on my system..can I access GP web services?...If I can,how it is possible

View 1 Replies

Control Within Ascx Is Null When Ascx Is Added From Codebehind?

Apr 14, 2010

I am having difficulties how to construct my question, but if I have to put it simply the situation is that I have categories of products. I have an aspx with a repeater on the left that lists the categories. And I want the products to be listed on the right. Category number is variable so I made an ascx with a DataList in it. When I try to do foreach category, ascx = new ascx(); then the DataList within this ascx control is null.

ps: what I want to do is to preload all the products (thre is not much) and hide the divs and fadein fadeout them using jQuery when a category div is clicked.

rightnow it is using jQuery.load(); and I don't like how the images load, cuz they download from top to bottom. Progressive gifs alsdo not an option. site demo is here [URL]

View 1 Replies

Unable To Call The SharePoint Custom Web Service From Another SharePoint Farm

Jan 12, 2011

I have deployed a custom SharePoint Web service on Farm A. I am trying to access this Web service from a SharePoint timer job on Farm B. On Farm B, I am creating Class Library project, packaging it (wsp) and then deploying to GAC. The problem is I'm unable to access the Web Service using the following code. TodaysNewSVC is a service reference

TodaysNewSVC.GetTodaysnewsfromInsite objGetNews = new TodaysNewSVC.GetTodaysnewsfromInsite();
objGetNews.PreAuthenticate = true;
objGetNews.Credentials = CredentialCache.DefaultCredentials;
objGetNews.Url = "http://insite-dev.portal/_vti_bin/todaysnews.asmx";
DataTable dt2 = objGetNews.getNewsFromInsite(true, true);

//getNewsFromInsite is a WebMethod which returns the DataTable.

Note: Both farms use the same active directory authentication. I have also done the debugging for Timer Job and feature activation and they are working fine. The problem occurs during the call i.e. getNewsFromInsite
The asmx and wsdl files are accessible from Internet Explorer and also from Windows Console application. Here is the code which I use from console application:

GetTodaysnewsfromInsiteSoapClient objWSClient = new GetTodaysnewsfromInsiteSoapClient();
objWSClient.ClientCredentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;[code]...

Here is the error message:The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="%2fPages%2fproblem-with-page.aspx%3fc%3d500">here</a>.</h2>
</body></html>

View 1 Replies

Security :: Best Practices For Handling SecurityException?

Sep 8, 2010

I have locked a set of administration pages on a website using the PrincipalPermission syntax ie:

<PrincipalPermission(SecurityAction.Demand, Role:=RoleBLL.ROLE_NAME_ADMINISTRATOR)>

View 3 Replies

Configuration :: SecurityException In Medium Trust Mode?

Nov 5, 2010

I have an actionlessform class that is giving me issues in Medium Trust. I have narrowed down what the cause is.

Here is the class:

[Code]....

The bolded line is where the problem lies. Specifically if I remove "BindingFlags.NonPublic" it will work in medium trust.

View 3 Replies

Iframe Opening A New Browser Window On Post-back In Dynamics CRM?

Aug 10, 2010

i trying to add some costume app into Dynamics CRM

basically i have an ASP.Net Page i show within an iframe inside the MS CRM.

when i try to do a submit using a button it opens a new window and shows the result there, i want it to stay in the iframe.

this is the ASP.Net code:

[code]....

View 1 Replies

WCF / ASMX :: Error : When Calling WCF (.SVC ) Web Service / System.Security.SecurityException?

Dec 30, 2010

I have wcf web service, I works fine on my local machine,but when I move it to live then it throws following error

System.Security.SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.

View 2 Replies

Windows Server 2003 - Site Throwing A System.Security.SecurityException?

Jan 14, 2011

I have an ASP.NET application that was working fine on my server up until last night when I installed a bunch of windows updates, now it's throwing this exception : System.Security.SecurityException: Requested registry access is not allowed.Unfortunately there is some things that makes this hard to debug. I added the debug="true" attribute to the web.config file to get the line where the exception is lauched. The line identified in my code is an End If and the code just before seems benign :

<body id="body" runat="server">
<div class="conteneur-confirmation">
<%

[code]...

View 3 Replies

Many Ascx-to-one Ascx.cs Error In VS2008?

Mar 16, 2010

I'm developing second language support for the site. So I made duplicate .ascx and .aspx files for existing ascx.cs and aspx.cs

Most of the time everything works fine.. but suddenly I'm getting:

Type 'ctrl_car' exists both in 'c:WindowsMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
zhdengined072cc729d5698bApp_Web_xdmblegv.dll', and in 'c:WindowsMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
zhdengined072cc729d5698bApp_Web_gkptrzo2.dll' (translated from russian)
ctrl_car ctrl = (ctrl_car) LoadControl("car.ascx");

I have few such strings of code... and same error occurs with one of them. But WITHOUT any changes from me with those files. To fix thaat bug for some time I need to delete solution and website folder and reget them from SS. Solution was converted from vs2005.

View 3 Replies

Error: "Could Not Load Type 'Microsoft.SharePoint.WebControls.SPGridView" SharePoint 2010

Jun 15, 2010

Following error comes when creating a WebPart In sharePoint 2010 Server.

Web Part Error: Unhandled exception was thrown by the user code wrapper's Execute method in the partial trust app domain: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.TypeLoadException: Could not load type 'Microsoft.SharePoint.WebControls.SPGridView' from assembly 'Microsoft.SharePoint, Version=14.900.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. at ListMenuSample.ListMenuSample.ListMenuSample.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() 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.ProcessRequest(HttpContext context) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.ExecuteHttpRequest(SPUserCodeWebPartHttpRequestContext webPartExecutionContext, SPUserCodeWebPartHttpResponse httpRequestResponse) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.Execute(SPUserCodeExecutionContext executionContext) at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext)

View 1 Replies

C# - Communicating With Microsoft Dynamics GP Database And Project DataBase

Feb 2, 2010

I am coding in ASP.NET C#. I have Microsoft Dynamics GP hosted at a server and my database hosted at another server. I would like the GP database take value from some table there and synchronise it with my database. Which is the best alternative? Data transmission Service(DTS)?

View 1 Replies

Security :: System.Security.SecurityException: Request Failed?

Jun 21, 2010

I got the error

System.Security.SecurityException: Request failed.

when i use project dll in my code.

View 3 Replies

Web Forms :: How To Inherit .ascx Page To Another .ascx Page

Sep 16, 2010

i have made a BaseUserControl.ascx and a ChildUserControl.ascxfile. both have its own code behind file.So what i want, i wanted to inharit ChildUserControl.ascx fileto BaseUserControl.ascx. so whatever in my BaseUserControl.ascx fileshould be visible into the ChildUserControl.ascx,means if i have kept a TextBox in BaseUserControl.ascx should be visibleinto the ChildUserControl.ascx desing view. and it should be accessible into the ChildUserControl.ascx code behind file.

1) Is this possible, if yes then how?

2) if above is possible then How to access BaseUserControl.ascx code behind file into the ChildUserControl.ascx code behind file?

View 3 Replies

Integrating CKEditor In MVC 2?

Oct 22, 2010

I want to use CKEditor for a comment field in my ASP.NET MVC 2 application, but can't get it to work. Here is what I have:

The textarea where I try to integrate the editor:

[code]....

And the document ready function:

[code]....

I don't know if the problem is with the TextareaFor helper method, where I tried to set the id to Editor1. I'm pretty new to MVC as well, so I guessed this was how to do it.

View 2 Replies

CMS Integrating ASP MVC 2 Application?

Jan 27, 2011

I have created ASP.Net MVC 2 application. To manage the content on ViewPages I want to integrate with Content Management System.Is there any such CMS?

View 1 Replies

Security :: Getting Error System.Security.SecurityException?

Apr 5, 2010

I'm getting the error

"System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

When trying to access my simply aspx form on our local network. It works fine when debugging using Microsoft Visual studio 2008 however, when I deploy the aspx form on IIS 7.0 I get the error above. The form was working fine until I added a ajax calendar extender. I've also reviewed other posts relating to this one, such as changing<trust level="Full"> with no avail. I have listed a portion of my web.config file below.

<system.web>
<trust level="Full" originUrl=""/>
<compilation debug="false">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

[Code]....

View 1 Replies

Experience Integrating Application With SAP?

Jan 11, 2010

Has anyone had an experience integrating ASP.NET application with SAP? If yes, I would like to hear about those experiences.

View 2 Replies

Integrating CMS Into An Existing Site?

Jan 20, 2011

I have developed an ASP.NET Web Application and am now looking in to integrating a CMS into it. Is there any open source tool that allows me to this?

I have many existing pages, with content in them, and want to make it possible to simply have some sort of plugin that can be used to add or edit the content - I am willing to convert the existing static content into the CMS database but want to keep the other functionality I have developed (A custom authorisation framework, a site layout and styling using master pages etc).

View 3 Replies

Integrating PayPal Subscription With C#.Net 2.0?

Aug 4, 2010

I am having a problem of integrating paypal with my site. All the process works great i.e., site successfully redirects to paypal and the users can successfully subscibe, but the problem is the "notify_Url" variable redirects the paypal to my site page but when I send a request from that page to validate the payment process the paypal always send the response as "Invalid". I am using a Subscribe button of paypal.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved