Here I am covering
1)Passing Url to Modal Popup from Server code in .cs file
i)add the hiddenfield control to .aspx page
Add following in Javascript tags
var url = document.getElementById('').value;
var options = {
url: url
title: "title",
allowMaximize: true,
showClose: true,
dialogReturnValueCallback: refreshCallback
};
function open() { SP.UI.ModalDialog.showModalDialog(options); }
function silentCallback(dialogResult, returnValue) {
}
function refreshCallback(dialogResult, returnValue) {
SP.UI.Notify.addNotification('Successful!');
SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
}
Invoke the function
asp:Label runat="server" ID ="lblr" Text ="Open Popup">
1)Passing Url to Modal Popup from Server code in .cs file
i)add the hiddenfield control to .aspx page
and set value in cs file
hdnUrl.Value = "../Lists/ListName/NewForm.aspx?RootFolder=&";
2)On Click of Ok button of Modal Popup Displaying the message in notification area which is part of sp2010 frameworkAdd following in Javascript tags
var url = document.getElementById('').value;
var options = {
url: url
title: "title",
allowMaximize: true,
showClose: true,
dialogReturnValueCallback: refreshCallback
};
function open() { SP.UI.ModalDialog.showModalDialog(options); }
function silentCallback(dialogResult, returnValue) {
}
function refreshCallback(dialogResult, returnValue) {
SP.UI.Notify.addNotification('Successful!');
SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
}
Invoke the function
asp:Label runat="server" ID ="lblr" Text ="Open Popup">
No comments:
Post a Comment