I want to create a site action menu item Custom Action which opens a Sharepoint 15 app (default.aspx) as modal dialog. is it possible? thanks.
There is out of the box support for opening a dialog from custom action. Add following attributes to the CustomAction XML node --
- HostWebDialog : Set it to true if you want to open a dialog
- HostWebDialogWidth: Width of the dialog
- HostWebDialogHeight: Height of the dialog
For more information go to my blog here. Hope this would help you.
Open Elements.xml file of custom action and add following attributes in tag.
HostWebDialog="TRUE" HostWebDialogWidth="600" HostWebDialogHeight="400
and then in your aspx page add
<WebPartPages:AllowFraming ID="AllowFraming" runat="server"/>
For detail documentation go to this link - How to create custom action opens in Modal - SharePoint App
You should be able to do it through the following way:
1) Create a SharePoint page: placeHolder.aspx
2) Create an AppPart/Client WebPart for your App and place it on placeHolder.aspx
3) Open placeHolder.aspx inside the Modal Dialog
4) Open the Modal Dialog from a custom action.