使用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);

posted @ 2011-04-12 17:48  Hayden Han  阅读(278)  评论(0编辑  收藏  举报