mardi 3 mars 2015

Call application page from a custom action in Visual Studio 2013



I have created a Ribbon custom action in Visual Studio 2013 that looks like this



<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://ift.tt/sQmbje">
<CustomAction Id="527e9f52-17b1-430c-b83d-919412c0b5ef.RibbonCustomAction1"
RegistrationType="List"
RegistrationId="{$ListId:enovia;}"
Location="CommandUI.Ribbon"
Sequence="10001"
Title="Invoke &apos;RibbonCustomAction1&apos; action">
<CommandUIExtension>
<!--
Update the UI definitions below with the controls and the command actions
that you want to enable for the custom action.
-->
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
<Button Id="Ribbon.ListItem.Actions.RibbonCustomAction1Button"
Alt="Request RibbonCustomAction1"
Sequence="100"
Command="Invoke_RibbonCustomAction1ButtonRequest"
LabelText="Request RibbonCustomAction1"
TemplateAlias="o1"
Image32by32="_layouts/15/images/placeholder32x32.png"
Image16by16="_layouts/15/images/placeholder16x16.png" />
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler Command="Invoke_RibbonCustomAction1ButtonRequest"
CommandAction="industrial-ex/_layouts/15/SharePointProject1/ApplicationPage1.aspx"/>
</CommandUIHandlers>
</CommandUIExtension >
</CustomAction>
</Elements>


In CommandAction="industrial-ex/_layouts/15/SharePointProject1/ApplicationPage1.aspx" I call my application page. This in turn should execute the custom C# code. But when I try to deploy my project i get this error:



Error occurred in deployment step 'Install app for SharePoint': There were errors when validating the App Package.


Why do I get this error?








0 commentaires:

Enregistrer un commentaire