Advertisement

05.10.2005 at 04:11PM PDT, ID: 21419723
[x]
Attachment Details

Adding a simple web part.

Asked by aero-owner in MOSS-Sharepoint

Tags: web, part, sharepoint

Hello experts,

I've been tasked with setting up some web parts so that our marketing dept can do whatever with the apps we write, but I've hit a snag.

As with any new task, I start with the easy one.

So I followed the instructions that Suraj Poozhiyil ( http://www.sharepointcustomization.com/resources/demos.htm ) from Microsoft shows to just build a simple Hello World web part.

Got the template in VS.Net, loaded in C# and VB (but I'm using C#)

Create the web part library, rename it to MyHelloWorld

Change output.Write(SPEncode.HtmlEncode(Text)); to output.Write('Howdy World");

Change the output directory to the bin directory on my sharepoint site (I have sharepoint and vs.net on the same box...and I have some confusion on this, as I'm not a share point guy...not sure I have the right directory...in IIS it shows my _vti_bin to be C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\isapi  which also has bin directory one step down, I have tried both of those and the inetpub\wwwroot\bin directory to no avail)

Build the app.

Go into sharepoint, edit page, import and browse to my MyHelloWorld.dwp, hit upload and then it displays on the tool bar.

However, when I try and drag it on the page I get "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."

According to the demo I watched...I did everything as told...so I dug a little further.

Using SA.exe I strongly named my assembly, dragged it to c:\windows\assembly got the key from the properties

edited my web.config file (the one in the home directory for my sharepoint site) with <SafeControl Assembly="MyHelloWorld, Version=1.0.0.1, Culture=neutral, PublicKeyToken=6b6979e152d8c840" Namespace="HelloWorldWebPart" TypeName="*" Safe="True" />

copied keypair.snk to the root of C: (and all 3 bin directories) and changed my assembly.cs to show c:\\keypair.snk for the location.

ever after all of this...still getting "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."

What am I missing?

Thanx in advance,

BrianStart Free Trial
[+][-]05.11.2005 at 03:28PM PDT, ID: 13982568

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.11.2005 at 03:28PM PDT, ID: 13982575

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.13.2005 at 08:48PM PDT, ID: 14001131

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.26.2005 at 11:50AM PDT, ID: 14088968

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MOSS-Sharepoint
Tags: web, part, sharepoint
Sign Up Now!
Solution Provided By: _TAD_
Participating Experts: 3
Solution Grade: A
 
 
[+][-]05.26.2005 at 04:35PM PDT, ID: 14090961

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32