A few days
ago I was working with Item deleting event in the share point. I had to update
some of the referenced items in the other records in the same list when an item
was being deleted.
realized the a major problem in doing so since the SPContext.Current does not
provide us with the context of the site in the overridden ItemDeleting event.
new SPSite(properties.SiteId) failed to generate an object of the site. I know
I can easily create the SPSite object by hard-coding the Site URL, but that is
something that I did not wanted to do.
of my friends told me to use the following code to get the SPWeb object.
SPWeb web = properties.ListItem.Web
getting the SPWeb object the work was easily done.