I have created a CustomAction feature to add a button to the "Actions" menu on a list. When I don't specify the ControlAssembly/ControlClass attributes then the button shows up. When I specify those attributes the button does not show up. I have tried adding a matching SafeControl element in the site web.config. I am using VSeWSS.
UPDATE - removed link to other question - not sure how i did that. My question is can anyone tell me why my CustomAction button is not showing up when I specify the ControlAssembly and ControlClass attributes ?
UPDATE 2 - RegenConfigTemp actually does inherit from WebControl, sorry! My machine with web access is different from my dev machine and there is no way to move files between them short of burning a CD.
here are my files:
manifest.xml <?xml version="1.0" encoding="utf-8"?> <Solution SolutionId="GUIDHERE" xmlns="http://schemas.microsoft.com/sharepoint/"> <FeatureManifests> <FeatureManifest Location="RegenConfigTemp\feature.xml" /> </FeatureManifests> <Assemblies> <Assembly Location="WebFeature.dll" DeploymentTarget="GlobalAssemblyCache" /> </Assemblies> </Solution>
feature.xml <Feature Id="GUIDHERE" Title="RegenConfigTemp" Scope="Web" Version="1.0.0.0" Hidden="FALSE" DefaultResourceFile="core" xmlns="http://schemas.microsoft.com/sharepoint/"> <ElementManifests> <ElementManifest Location="RegenConfigTemp\Module.xml" /> </ElementManifests> </Feature>
Module.xml <?xml version="1.0" encoding="utf-8"?> <Elements Id="GUIDHERE" xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Id="GUIDHERE" RegistrationType="List" RegistrationId="1981" GroupId="ActionsMenu" Location="Microsoft.SharePoint.StandardMenu" Sequence="1000" Title="Regenerate List Contents" ControlAssembly="WebFeature, Version=1.0.0.0, Culture=neutral, PublicKeyToken=myPKTokenHere" ControlClass="WebFeature.RegenConfigTemp" ></CustomAction> </Elements>
RegenConfigTemp.cs using System; using System.Runtime.InteropServices; using System.Web.UI.WebControls; using Microsoft.SharePoint.WebControls; namespace WebFeature { [Guid("GUID HERE MATCHES 1st GUID in Module.xml")] public class RegenConfigTemp : WebControl { protected override void OnLoad(EventArgs e) { this.EnsureChildControls(); base.OnLoad(e); } protected override void CreateChildControls() { base.CreateChildControls(); } } }
I added the following to the web.config
<SafeControl Assembly="WebFeature, Version=1.0.0.0, Culture=neutral, PublicKeyToken=myPKTokenHere" Namespace="WebFeature" TypeName="RegenConfigTemp" Safe="True" />