使用SharePoint 2010 对话框模式
//引用sp.ui.dialog.js
ExecuteOrDelayUntilScriptLoaded(showMyModalDialog, ‘sp.ui.dialog.js’);
//加入如下javascript
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); }; ” +
// 注册脚本
this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), “modalDialogBox”, myJavascript);