Archive

Archive for the ‘video tutorial’ Category

How to use SharePoint modal dialog box to display Custom Page Part2

May 23, 2012 Leave a comment

In the first part of the series, I showed you how to display and close a custom page in a SharePoint modal dialog using JavaScript. In this one, I’d like to show you how to display some information after the Modal dialog is closed.You can download the source code here.

1. Firstly, modify the element file as follow

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="ReportConcern"
RegistrationType="ContentType"
RegistrationId="0x010100866B1423D33DDA4CA1A4639B54DD4642"
Location="EditControlBlock"
Sequence="107"
Title="Display Custom Page"
Description="To Display Custom Page in a modal dialog box on this item">
<UrlAction Url="javascript:
function emitStatus(messageToDisplay) {
statusId = SP.UI.Status.addStatus(messageToDisplay.message + ' ' +messageToDisplay.location );
SP.UI.Status.setStatusPriColor(statusId, 'Green');
}
function portalModalDialogClosedCallback(result, value) {
if (value !== null) {
emitStatus(value);
}
}
var options = {
url: '{SiteUrl}' + '/_layouts/YBBEST/TitleRename.aspx?List={ListId}&amp;ID={ItemId}',
title: 'Rename title',
allowMaximize: false,
showClose: true,
width: 500,
height: 300,
dialogReturnValueCallback: portalModalDialogClosedCallback };
SP.UI.ModalDialog.showModalDialog(options);" />
</CustomAction>
</Elements>

2. In your code behind, you can implement a close dialog function as below. This will close your modal dialog box once the button is clicked and display a status bar.

protected static string GetCloseDialogScript(string message)
{
var scriptBuilder = new StringBuilder();
scriptBuilder.Append("<script type='text/javascript'>" + "SP.UI.ModalDialog.commonModalDialogClose(1,").Append(message).Append("); </script>");
return scriptBuilder.ToString();
}
Categories: SharePoint, video tutorial

Video Tutorial(Continuous Updating)

January 4, 2010 Leave a comment

Videos from Øredev 2009

http://oredev.org/videos

ASP.NET 4, ASP.NET MVC, and Silverlight 4 Videos of ScottGu’s Talks in Europe

http://weblogs.asp.net/scottgu/archive/2010/01/02/asp-net-4-asp-net-mvc-and-silverlight-4-videos-of-my-talks-in-europe.aspx

NDC 2009

http://arkiv.ndc2009.no/agenda.aspx

http://blogs.msdn.com/grothaug/attachment/9824787.ashx

Microsoft TechDays in Belgium, 10-12 March 2009

http://www.microsoft.com/belux/techdays/2009/about.aspx

NDC2008

http://www.viddler.com/explore/oredev/videos/

Categories: video tutorial