リストの[アクション]メニューにボタンを追加するカスタムアクション機能を作成しました。 ControlAssembly/ControlClass属性を指定しないと、ボタンが表示されます。これらの属性を指定すると、ボタンは表示されません。私はサイトweb.configに一致するSafeControl要素を追加しようとしました。私はVSeWSSを使用しています。リストの[アクション]メニューにボタンを追加する
UPDATE - 他の質問へのリンクを削除しました。 ControlAssemblyとControlClassの属性を指定すると、私のCustomActionボタンが表示されない理由を誰でも教えていただけますか?
更新2 - RegenConfigTempは実際にWebControlから継承します。ごめんなさい! Webアクセスが可能な私のマシンは私の開発マシンとは異なり、CDを焼くほどの間にファイルを移動する方法はありません。ここ
が私のファイルです:
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(); } } }
私はweb.configファイル
<SafeControl Assembly="WebFeature, Version=1.0.0.0, Culture=neutral, PublicKeyToken=myPKTokenHere" Namespace="WebFeature" TypeName="RegenConfigTemp" Safe="True" />
これは、この質問に対する回答であると思われますか? –
本当の質問ではないと投票しました –