单击网格视图中的链接时,我需要像弹出窗口一样显示 Sharepoint 2010。一旦显示模态弹出窗口并且用户选择了保存按钮数据库,应该使用弹出窗口中的给定值进行更新。我怎么能得到这个。任何想法。
截至目前,我正在使用下面的代码来获取它,但不知道如何在单击弹出窗口中的按钮后将值传递给数据库
注意:到目前为止,我没有在此处添加 gridview 代码,因为我想先使用示例 html 来实现它,然后再使用网格视图来实现。
Java 脚本
function openDialog() {
var options = {
html: divModalDialogContent, // ID of the HTML tag
// or HTML content to be displayed in modal dialog
width: 600,
height: 300,
title: "My First Modal Dialog",
dialogReturnValueCallback: dialogCallbackMethod, // custom callback function
allowMaximize: true,
showClose: true
};
SP.UI.ModalDialog.showModalDialog(options);
}
//Results displayed if 'OK' or 'Cancel' button is clicked if the html content has 'OK' and 'Cancel' buttons
function onDialogClose(dialogResult, returnValue) {
if (dialogResult == SP.UI.DialogResult.OK) {
alert('Ok!');
}
if (dialogResult == SP.UI.DialogResult.cancel) {
alert('Cancel');
}
}
// Custom callback function after the dialog is closed
function dialogCallbackMethod() {
alert('Callback method of modal dialog!');
}
HTML
<div id="divModalDialogContent">
Hello World!
<input type="button" value="OK"onclick="SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, 'Ok clicked'); return false;"
class="ms-ButtonHeightWidth" />
<input type="button" value="Cancel"onclick="SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel, 'Cancel clicked'); return false;"
class="ms-ButtonHeightWidth" />
<asp:Button runat="server" ID="btnClicked" Text="Clicked"
onclick="btnClicked_Click" />
<input type="button" value="Open" onclick="openDialog()" />
如何在单击弹出窗口中的“单击”按钮时调用 db。我还需要将参数发送到弹出窗口
提前致谢