i have read a consise tutorial (wsssdk.chm, from microsoft on how to
develop web parts). now anythime i try to import the web part i get the
following 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.
when i try also installing it with the web part tool
InstallAssemblies.exe i get errors generating the .dwp files
what could possibly be wrong with the deployment. below is the code i
used.
can u please help me out.
i have made all the entries in the web.config file as ff
************************************************************************\
******************
<SafeControl Assembly="KPI, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=23a6c311525709e9" Namespace="GhanaGoldNetKPI"
TypeName="*" Safe="True" />
************************************************************************\
*******************
the KPI.cs file is like
this>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.SharePoint.WebPartPages;
using System.Xml.Serialization;
using System.Web.UI.HtmlControls;
namespace KPI
{
[DefaultProperty("Text")]
[ToolboxData("<{0}:GhanaGoldNetKPI
runat=server></{0}:GhanaGoldNetKPI>")]
[XmlRoot(Namespace = "KPI")]
public class NETKPI : WebPart
{
[Bindable(true)]
[Category("Appearance")]
[DefaultValue("")]
[Localizable(true)]
public string Text
{
get
{
String s = (String)ViewState["Text"];
return ((s == null) ? String.Empty : s);
}
set
{
ViewState["Text"] = value;
}
}
protected override void RenderWebPart(HtmlTextWriter output)
{
output.Write("<hi>Net Ghana KPI</hi>");
}
}
}
************************************************************************\
*************
the assembly info has this info
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the
following
// set of attributes. Change these attribute values to modify the
information
// associated with an assembly.
[assembly: AssemblyTitle("NetKPI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NetKPI")]
[assembly: AssemblyCopyright("Copyright © 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyDelaySign(false)]
// Setting ComVisible to false makes the types in this assembly not
visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is
exposed to COM
[assembly: Guid("9aa82781-75af-4b9d-bc29-9977a39cea3e")]
// Version information for an assembly consists of the following four
values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and
Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
the KPI.dwp is like this>>>>>>>>>>>>>>>
<?xml version="1.0"?>
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>KPI, Version=1.0.0.0, Culture=Neutral,
PublicKeyToken=23a6c311525709e9</Assembly>
<TypeName>KPI.NetKPI</TypeName>
<Title>KPI</Title>
<Description>developed by ally</Description>
</WebPart>
************************************************************************\