gpt4 book ai didi

c# - 通过代码将自定义链接添加到 SharePoint 列表设置页面

转载 作者:行者123 更新时间:2023-11-30 12:15:19 24 4
gpt4 key购买 nike

我想通过代码将自定义链接添加到 SharePoint 列表设置页面 (listedit.aspx),我搜索了网络和 Stack Overflow,但似乎无法找到任何具体执行此操作的示例或文档。

有很多关于如何从 elements.xml 和部署/激活中执行此操作的示例,但我想从 C# 代码中执行此操作,如下所示:

SPUserCustomAction customAction = spCustomList.UserCustomActions.Add();
customAction.Url = "someurlhere";
customAction.Name = "CustomName";
customAction.Location = "Microsoft.SharePoint.ListSettings";
customAction.Title = "Custom Settings";
customAction.Update();
spCustomList.Update();

最佳答案

你走在正确的轨道上,但你的位置不正确,你需要一个组。

尝试以下操作:

SPUserCustomAction customAction = spCustomList.UserCustomActions.Add();
customAction.Url = "someurlhere";
customAction.Name = "CustomName";
customAction.Location = "Microsoft.SharePoint.ListEdit";
customAction.Group = "GeneralSettings";
customAction.Title = "Custom Settings";
customAction.Update();

有关位置的更多信息,请参阅 Default Custom Action Locations and IDs .

关于c# - 通过代码将自定义链接添加到 SharePoint 列表设置页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7645174/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com