Wednesday, May 30, 2012

Open new modal popup while closising the parent modal popup.

Parent page code :

var siteUrl = http://siteurl/;

var modalpage = { url: siteUrl + "/_layouts/MyModal/Pages/NewModalForms.aspx", title: "New  Input Form", allowMaximize: false, width: 700, height: 300, showClose: true, dialogReturnValueCallback: silentCallback };

function openModalForm() {
SP.UI.ModalDialog.showModalDialog(modalpage);
}

function silentCallback(dialogResult, returnValue)
{

if (returnValue != null && returnValue != "")
{
OpenPopUpPageWithTitle(siteUrl + '/Lists/lst/NewForm.aspx?' + returnValue, RefreshOnDialogClose, null, null, 'New Modal Form');
}

}
 
Modalpopup page code
 
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel, queryString);
 

Tuesday, May 22, 2012

How to Restore Deleted sitecollection in sharepoint 2010

Hi all  unfortunatly i have deleted  site collections in sharepoint 2010 . I am able to restored it using powerscript.


if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)


{
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
foreach($m in Get-SPDeletedSite)
{
Restore-SPDeletedSite -Identity $m
}