We help IT Professionals succeed at work.

SPContext.Current is returning null in the "SPItemEventReceiver" event handler.

RaviPerla
RaviPerla asked
on
Hi Experts,

SPContext.Current is returning null in the "SPItemEventReceiver" event handler.

Can you please suggest me. Thank you

P.L. RAVI KANTH
Comment
Watch Question

Jamie McAllisterCloud Expert
Most Valuable Expert 2013
Top Expert 2014

Commented:
Use properties instead of SPContext when coding in event handlers.
Cloud Expert
Most Valuable Expert 2013
Top Expert 2014
Commented:
Code sample didn't attach just now, so here it is.

using(SPWeb web = properties.OpenWeb()) {

}