I want to put either custom HTML string OR custom .aspx page url in SP modal dialog
function OpenCustomForm() {
var options = SP.UI.$create_DialogOptions();
options.url = "/sites/link/to/customPage.aspx";
options.dialogReturnValueCallback = function(result) {
if (result === SP.UI.DialogResult.OK) {
SP.UI.ModalDialog.RefreshPage(result);
}
};
SP.UI.ModalDialog.showModalDialog(options);
}
What are best practice between them?
- Custom HTML - I know it does not accept HTML string. should be provide DOM elements
- Custom .aspx page - when i am trying to open custom page in modal dialog, error occurs with message "Sorry something went wrong"