Kevin
Kevin

Reputation: 1

Have link in sharepoint open in iFrame on same webpapge

In Sharepoint I have multiple links from various external links that I want to open on an iFrame within the same Sharepoint page.

Ex:

Link A | Link B | Link C

Regardless of whichever link is clicked it will open in the same iFrame

Upvotes: 0

Views: 1246

Answers (1)

Ankur
Ankur

Reputation: 126

To open webpage in modal popup

<script type="text/javascript">
function OpenDialog(URL) {
   var NewPopUp = SP.UI.$create_DialogOptions();
   NewPopUp.url = URL;
   NewPopUp.width = 700;
   NewPopUp.height = 350;
   SP.UI.ModalDialog.showModalDialog(NewPopUp);
}
</script>

Call the Javascript on Button click and the modal Pop Up will pops up with the Page of Specified URL.

btnOpenPopUp.Attributes.Add("onClick", "javascript:OpenDialog(‘/_layouts/MyAppPage/MyPage.aspx’);");

If still it not works try to execute delay like this

SP.SOD.executeOrDelayUntilScriptLoaded(initialize, 'sp.ui.dialog.js');

Upvotes: 1

Related Questions