--For opening pop up--
Write Below Script on page
<script type="text/javascript">
function openDialogModal() {
var options =
{
url: $("#<%= EditTaskUrl.ClientID %>").val(),
width: 800,
height: 600,
title: $("#<%= hiddenTitle.ClientID %>").val(),
dialogReturnValueCallback: refreshCallback
};
in code behind
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "CloseAndRefresh", "window.frameElement.commonModalDialogClose(1, 1);", true);
function openDialogModal() {
var options =
{
url: $("#<%= EditTaskUrl.ClientID %>").val(),
width: 800,
height: 600,
title: $("#<%= hiddenTitle.ClientID %>").val(),
dialogReturnValueCallback: refreshCallback
};
SP.UI.ModalDialog.showModalDialog(options);
function refreshCallback(dialogResult, returnValue) {
//SP.UI.Notify.addNotification('Operation Successful!');
SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
var siteUrl = $("#<%= hiddenCurrentSite.ClientID %>").val();
window.location = siteUrl
}
< / Script>
function refreshCallback(dialogResult, returnValue) {
//SP.UI.Notify.addNotification('Operation Successful!');
SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
var siteUrl = $("#<%= hiddenCurrentSite.ClientID %>").val();
window.location = siteUrl
}
< / Script>
Add Attribute as
OnClientClick= javascript : openSourceDialog(); return false;
--For closing pop up--
in code behind
No comments:
Post a Comment