SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

No matter what I do, before and after for title are always null. This is an item updated receiver in the meetings or event list

![public override void ItemUpdated(SPItemEventProperties properties)
            Logger.LogDebug("MeetingCalendarEvents", "ItemUpdated(SPItemEventProperties properties)", "BEGIN");
                base.EventFiringEnabled = false;
                SPSite site = properties.Web.Site;
                string sitename= properties.BeforeProperties\["Title"\].ToString();
                SPWeb web = site.RootWeb.Webs\[sitename\];
                web.AllowUnsafeUpdates = true;
                string prefix = properties.BeforeProperties\["Title"\].ToString().Substring(0, 2);
                web.Title = properties.AfterProperties\["Title"\].ToString();
                DateTime eventDate = properties.AfterProperties.GetValueAsDateTime(MeetingsCommon.Constants.FIELDS_EVENTDATE_NAME);
                if (eventDate != DateTime.MinValue)
                    string titleMeetingCalendarItem = eventDate.ToString("yyyyMMdd");
                    titleMeetingCalendarItem = string.Format("{0}{1}", prefix, titleMeetingCalendarItem);
                    properties.AfterProperties.SetAfterPropertyValue("Title", titleMeetingCalendarItem);
                    web.ServerRelativeUrl = "/" + titleMeetingCalendarItem;               

                web.AllowUnsafeUpdates = false;
                base.EventFiringEnabled = true;
            catch (Exception ex)
                Logger.LogError("MeetingCalendarEvents", "ItemUpdated(SPItemEventProperties properties)", ex);
                properties.ErrorMessage = ex.Message;
                properties.Cancel = true;
                base.EventFiringEnabled = true;
            Logger.LogDebug("MeetingCalendarEvents", "ItemUpdated(SPItemEventProperties properties)", "END");
share|improve this question
up vote 1 down vote accepted

You should try to use the ItemUpdating instead of the itemupdated event. In the itemupdated event, there aren't any before and after properties! Only while updatING...

share|improve this answer
I dont think thats correct. – Esteban V Aug 2 '12 at 14:54
but yes, I suppose I can use the item updating event. – Esteban V Aug 2 '12 at 14:55
the code doesnt work either on item updating event., beforeproperties["Title"] is always null – Esteban V Aug 2 '12 at 15:06
If you look at the blog post you linked to, it says that beforeproperties is always NULL in a list, use properties.ListItem instead. – Anders Aune Aug 2 '12 at 18:13

Your Answer


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.