Close Model Dialog Box in SharePoint 2010

Hi ,


If you want to close your open dialog box, you can use below given scripts :


To send cancel result on the parent form :
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel,' Your Message Here '); 



also you can use this script to send Cancel result message on the parent form :
window.frameElement.cancelPopup();



To send OK result on the parent form from current form :
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, 'Your Message Here'); 


also you can use this script to send commit result message on the parent form :
window.frameElement.commitPopup();


You can use this script in your programming to close the model dialog box in SharePoint 2010

Comments

Steve Hamilton said…
You made some decent points there. I looked on the internet for the issue and found most individuals will go along with with your website.
dotNetFollower said…
Nice brief article! Thanks! I have a logically related article in my blog - SharePoint: How to close a Modal Dialog Window. Probably, it could be interesting for you too.

Popular Posts

SharePoint Interview Questions and Answers

Download Infopath Form Templates

How to get current logged user information using JavaScript ?

Steps to set Form based authentication (FBA) for SharePoint 2010

SharePoint Interview Questions and Answers II

Get List Items - JavaScript

Change Language for current user with JSOM in SharePoint Online

Cross Site List Rollup Web Part for SharePoint 2010

Hide Recently Modified Items

SharePoint 2010 CSS Chart