Code to Open modal dialog from WebPart Sharepoint 2010
//add javascript for dialog
String myJavascript = "var showMyModalDialog = function() { ” +
var options = { "+
url: targetUrl,
title: 'Custom dialog',
width: 980,
height: 580,
dialogReturnValueCallback: function (dialogResult, returnValue) " +
{
if (dialogResult === 1)
{ // the user accepted the dialog } " +
+"
else { // the user cancelled the dialog } " +
+ " }
};
SP.UI.ModalDialog.showModalDialog(options);
}; "
// Register the script
this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "modalDialogBox", myJavascript);
0 comments:
Post a Comment