0

当我使用来自 xml 的常规自定义操作时,它具有:

<UrlAction Url="~remoteAppUrl/Pages/Default.aspx?{StandardTokens}&amp;SPListItemId={ItemId}&amp;SPListId={ListId}&amp;SPItemUrl={ItemUrl}" />

并且工作正常,但是当我使用时

Microsoft.SharePoint.Client.UserCustomAction _customAction = web.UserCustomActions.Add();
_customAction.RegistrationType = UserCustomActionRegistrationType.ContentType;
_customAction.RegistrationId = _guidOfCreatedCT;
_customAction.Location = "EditControlBlock";
_customAction.Sequence = 450;
_customAction.Title = "TEST";
string rrr =AppRelativeVirtualPath.ToString();
_customAction.Url = "~remoteAppUrl/Pages/Default.aspx?{StandardTokens}&amp;SPListItemId={ItemId}&amp;SPListId={ListId}&amp;SPItemUrl={ItemUrl}";
_customAction.Update();
clientContext.ExecuteQuery();

这个网址不起作用。我不知道如何格式化这个,我尝试了一切,仍然有任何想法。有人可以帮助我吗?

这是 Sharepoint 2013 的自动托管应用程序。

4

2 回答 2

1

您只需要在任何XML结构&amp;中替换&,但您不需要&amp;在后面的代码中使用...

于 2013-05-27T13:24:05.310 回答
0

只需尝试在您的自定义网址前使用 http:// 或 https://。否则,SharePoint 将认为操作 url 在 SharePoint 中,因此它会自动生成一个站点相关 url。

于 2014-05-19T15:13:35.867 回答