1

I have created a custom page and configured it as a Display form on SharePoint list. All the list forms are configured to Launch as a Dialog.'

Now I want my users to see a different page within the popup window upon clicking on a button on Display Form.

Please advise.

I have tried window.redirect, response.redirect, $.ajax POST. None of these worked.

  • I resolved this myself by replacing button with hyperlink and adding href to it dynamically. <a class="button k-button" target="_self" id="Edit">Edit</a> $('#Edit').attr('href', _spPageContextInfo.webAbsoluteUrl + "/_layouts/15/EditForm?ID="+ID); – Kalyan Polasi Oct 11 '17 at 21:23
1

You can use ModalDialog to open a link as popup window,

  • Edit your display form.

enter image description here

  • Add Script Editor web part > Edit Snippet.
  • Add the below code with your Link.

ModalDialog Code

<script>
function openDialog(pageUrl) {
var options = {
url: pageUrl,
title: 'Title of the Dialog',
allowMaximize: false,
showClose: true,
width: 500,
height: 500
};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
</script>
<a href="#" onclick="openDialog('http://siteURL');">Link</a>

For the details steps check Open a link via Modal Dialog in SharePoint

  • As I mentioned, this is my custom aspx application display page. which I am already loading as a modal dialog. I want the page within the modal dialog to be redirected to a new page upon a button click. – Kalyan Polasi Oct 11 '17 at 21:20
0

I resolved this myself by replacing button with hyperlink and adding href to it dynamically.

<a class="button k-button" target="_self" id="Edit">Edit</a> 

$('#Edit').attr('href', _spPageContextInfo.webAbsoluteUrl + 
"/_layouts/15/EditForm?ID="+ID); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.