A new feature of SharePoint 2010 is the modal dialog which resembles the classic Light Box behavior. This allows us to add and edit items, manage Meta data and perform administrative tasks within the context of a page without leaving the page.
In just two simple steps we can implement this.
Step1:
In your Master page/aspx page add this tag for java script function to be called. For me I have added this in my master page.
script type="text/javascript">
var options = {
url: "/Lists/Announcements/NewForm.aspx", //Add your url u want to redirect your link to
title: "Add New Announcement", //Add title to your pop up window
allowMaximize: true,
showClose: true,
width: 625,
height: 525,
dialogReturnValueCallback: silentCallback
};
function open()
{
SP.UI.ModalDialog.showModalDialog(options);
}
function silentCallback(dialogResult, returnValue)
{
}
function refreshCallback(dialogResult, returnValue)
{
SP.UI.Notify.addNotification('Operation Successful!');
SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
}
/script>
Step2:
Add this href anchor tag on link you want to create.
a href="javascript:open()">Click Here
:) Happy Coding
No comments:
Post a Comment