I have an Event Receiver that will fire when a SPListItem in a SPList is updated. I’m using the ItemUpdated() Event.
I want to get the values from before the event so I can compare which fields that have been edited.
How do I do that?
if (properties.ListTitle == "Lista")
{
if (properties.AfterProperties["Start Time"].ToString() != properties.ListItem["Start Time"].ToString())
{
string s = "hej";
}
}
try
{
// ID for the site from the properties object
Guid siteId = properties.SiteId;
// ID for the list from the properties object
Guid listId = properties.ListId;
// ID for the list item from the properties object
int listItemId = properties.ListItemId;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
// Code stuff
});
1 Answer