How to get current user using WSS 3.0 & Membership provider inside ItemDeleting event receiver method?
I need to get current user name in my Wss 3.0 application. What is more I would like to do this inside ItemDeleting method which is inside event receiver for SPList. I've tried SPContext and HttpContext objects but they doesn't work. I have to add that I'm using Membership Provid开发者_JAVA百科er and SQL Role provider. I'm not using Active Directory. Can anybody help me and tell is there a way to obrain currently logged in user name?
public override void ItemDeleting(SPItemEventProperties properties)
{
using (SPWeb web = properties.OpenWeb())
{
SPUser user = web.AllUsers.GetByID(properties.CurrentUserId);
}
}
No need for HttpContext or SPContext. :-)
精彩评论