Re: Custom Web Part
From: Greg Merideth (gmerideth.remove_at_this.forwardtechnology.net)
Date: 08/30/04
- Next message: Roland Whitmyre: "Re: Default Icons returning is portal search"
- Previous message: Jason MacKenzie: "Another Custom Web Part Question"
- In reply to: Jason MacKenzie: "Re: Custom Web Part"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 30 Aug 2004 15:31:18 -0400
Somewhere in your web.config you should have a line that reads
<trust level="xxx" originUrl="yyy"/>
That statement sets your working page to a certain trust level. If its minimal
then in your sharepoint folder (depends on wss or sps) (mines in C:\Program
Files\Common Files\Microsoft Shared\web server extensions\60\CONFIG) you will
have wss_mediumtrust.config and a wss_minimaltrust.config (i'm running wss not
sps hence the filenames).
Jason MacKenzie wrote:
> Hi Greg,
>
> Thanks for your response.
>
> "In the webconfig file what is the trust level set to? minimal, medium,
> full?
> If you add your references to the minimal but your web config is using the
> medium one then you can see the problem there."
>
> I'm not sure what this means exactly. Could you clarify it for me? I'm not
> sure where the trust level is set or what "If you add your references to the
> minimal.." means.
>
> Thanks
>
> "Greg Merideth" <gmerideth.remove@this.forwardtechnology.net> wrote in
> message news:PLydnQ942cty967cRVn-gQ@comcast.com...
>
>>Two things to check right off the bat.
>>
>>
>>> <TypeName>SharePointMenuWebPart.WebPartMenu</TypeName>
>>
>>means your namespace is SharePointMenuWebPart and the class name is
>>WebPartMenu, if thats not the case you can get that error.
>>
>>and since you have a token value I assume you've used sn to strongly type
>>the methods?
>>
>>In the webconfig file what is the trust level set to? minimal, medium,
>>full? If you add your references to the minimal but your web config is
>>using the medium one then you can see the problem there.
>>
>>
>>Jason MacKenzie wrote:
>>
>>
>>>I'm attempting to create a custom web part but I'm getting the error:
>>>
>>>"A Web Part or Web Form Control on this Web Part Page cannot be displayed
>>>or imported because it is not registered on this site as safe."
>>>
>>>I want to use our exisiting intranet menu functionality in this web part.
>>>Basically we have some web custom controls that we use to build the menu.
>>>I've added them in my web part code like this:
>>>
>>> Protected Overrides Sub CreateChildControls()
>>> Me.Controls.AddAt(0, LSS)
>>> Me.Controls.AddAt(1, CTMB)
>>> End Sub
>>>
>>>So there are basically three assemblies. My webpart dll and two menu
>>>system related ones. I've copied all three into my
>>>\\SharepointServer\inetpub\wwwroot\bin directory as well as my dwp file
>>>which looks like this:
>>>
>>>
>>><?xml version="1.0" encoding="utf-8"?>
>>><WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" >
>>> <Title>WebPartMenu</Title>
>>> <Description>WebPartMenu</Description>
>>> <Assembly>SharePointMenuWebPart</Assembly>
>>> <TypeName>SharePointMenuWebPart.WebPartMenu</TypeName>
>>> <!-- Specify initial values for any additional base class or custom
>>>properties here. -->
>>></WebPart>
>>>
>>>
>>>
>>>I've also changed the web.config file in my
>>>\\SharepointServer\inetpub\wwwroot and added the following tags under the
>>>SafeControls element:
>>>
>>>
>>><SafeControl
>>> Assembly="WebPartMenu, Version=1.0.0.0, Culture=neutral,
>>>PublicKeyToken=fce7acfa04aba17c"
>>> Namespace="WebPartMenu"
>>> TypeName="*"
>>> Safe="True"
>>>/>
>>><SafeControl
>>> Assembly="axdIntranet, Version=1.0.0.0, Culture=neutral,
>>>PublicKeyToken=403fa50f8c39f727"
>>> Namespace="CreateMenu"
>>> TypeName="*"
>>> Safe="True"
>>>/>
>>><SafeControl
>>> Assembly="MenuSystem, Version=1.0.1703.16992, Culture=neutral,
>>>PublicKeyToken=53d1c27d1a8fb412"
>>> Namespace="MenuSystem"
>>> TypeName="*"
>>> Safe="True"
>>>/>
>>>
>>>
>>>However when I upload the web Part and try to drag it onto the page I get
>>>the aforementioned error.
>>>
>>>Any idea what else I need to do?
>>>
>>>Thanks a lot,
>>>
>>>Jason MacKenzie
>
>
>
- Next message: Roland Whitmyre: "Re: Default Icons returning is portal search"
- Previous message: Jason MacKenzie: "Another Custom Web Part Question"
- In reply to: Jason MacKenzie: "Re: Custom Web Part"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|