In SharePoint 2010, we used JavaScript to open the URL in a modal dialog. In SharePoint 2010, we used to write JavaScript to make the URL open in the modal dialog. If we write EditControlBlock
actions, we used JavaScript as follows:
<CustomAction
Id="Custom.ProvisionGroup"
Location="EditControlBlock"
Title="My Custom Action"
RegistrationType="ContentType"
RegistrationId="0x01"
ImageUrl="/_layouts/images/editicon.gif" >
<UrlAction Url="javascript:OpenPopUpPageWithTitle
('{SiteUrl}/_layouts/myCustom/default.aspx?List={ListId}&ID={ItemId}',
RefreshOnDialogClose, 600, 400,'My Custom Action')" />
</CustomAction>
In SharePoint 2013 using JavaScript encountered:
Error occurred in deployment step 'Install app for SharePoint':
There were errors when validating the App Package.
Thus for SharePoint 2013, we need to use three special attributes in CustomAction
.
="1.0"="utf-8"
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="a266876f-6356-4342-91a3-ef3d55b1e570.MenuItemCustomAction1"
RegistrationType="ContentType"
RegistrationId="0x01"
Location="EditControlBlock"
Sequence="10001"
Title="Invoke 'MenuItemCustomAction1' action"
HostWebDialog="TRUE"
HostWebDialogHeight="420"
HostWebDialogWidth="510"
>
<UrlAction Url="~appWebUrl/Pages/Default.aspx?{StandardTokens}&
SPListItemId={ItemId}&SPListId={ListId}"/>
</CustomAction>
</Elements>