Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I need to find out page layout on ItemUpdated from the SPItemEventProperties in a page library. What property value should I be looking for.

share|improve this question
add comment

2 Answers 2

up vote 0 down vote accepted

You can't it isn't available, look at ItemUpdating and treat it as ItemUpdated.

Do this with

SPListItem.SystemUpdate()

As it doesn't fire off updated.

Then layout is in

Microsoft.SharePoint.Publishing.PageLayout.Name;

PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(SPContext.Current.Web);
SPFile file = SPContext.Current.File;
Guid guid = file.UniqueId;
PublishingPage publishingPage = PublishingPage.GetPublishingPage(publishingPages[id].ListItem);
string pageName = publishingPage.Layout.Name;
share|improve this answer
    
I figured it out SPListItem item = properties.ListItem; item.properties["PublishingPageLayout"] provides the value. –  SharePoint Support Nov 30 '12 at 15:51
    
Can you post it as your answer please when it is ready. It isn't listed as being in there on msdn, but I did look :P –  Hugh Wood Nov 30 '12 at 16:00
add comment

I would presume your talking about this?

http://sharing-the-experience.blogspot.co.uk/2011/03/spitemeventproperties-itemupdated.html

if its through code then you need to make an event reciver and have this:

public override void  ItemUpdating(SPItemEventProperties properties) 
{     
      base.ItemUpdating(properties); 
}

http://msdn.microsoft.com/en-us/library/ff713708(v=office.12).aspx

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventproperties_properties.aspx

hope it helps :)

share|improve this answer
    
Thanks everyone for your answers. I figured it out SPListItem item = properties.ListItem; string pageLayout =item.properties["PublishingPageLayout"].ToString(); provides the value. –  SharePoint Support Nov 30 '12 at 15:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.