Tweeted twitter.com/StackSharePoint/status/1023402869461004288
2 typo corrections, layout
source | link

I created one event receiver and deployed it, but only users who are site collection admins are able to view this web part..i I have included the SPsecurity.runwithelivatedpriveldegesSPSecurity.butRunWithElevatedPrivileges but the same thing,.what What am iI missing?... below

Below is my code

 public override void ItemAdding(SPItemEventProperties properties)
    base.ItemAdding(properties);
    SPSecurity.RunWithElevatedPrivileges(delegate()
       {SPWeb web = properties.OpenWeb();
        base.ItemAdding(properties);
        string name= web.Lists[properties.ListId].Fields["first name"].InternalName; 
        var list = web.Lists["location names"]; 
  });}

SPSecurity.RunWithElevatedPrivileges(delegate() {SPWeb web = properties.OpenWeb(); base.ItemAdding(properties); string name= web.Lists[properties.ListId].Fields["first name"].InternalName; var list = web.Lists["location names"]; });}

I created one event receiver and deployed it, but only users who are site collection admins are able to view this web part..i have included the SPsecurity.runwithelivatedpriveldeges.but the same thing,.what am i missing?... below is my code

public override void ItemAdding(SPItemEventProperties properties)
   base.ItemAdding(properties);

SPSecurity.RunWithElevatedPrivileges(delegate() {SPWeb web = properties.OpenWeb(); base.ItemAdding(properties); string name= web.Lists[properties.ListId].Fields["first name"].InternalName; var list = web.Lists["location names"]; });}

I created one event receiver and deployed it, but only users who are site collection admins are able to view this web part. I have included the SPSecurity.RunWithElevatedPrivileges but the same thing. What am I missing?

Below is my code

 public override void ItemAdding(SPItemEventProperties properties)
    base.ItemAdding(properties);
    SPSecurity.RunWithElevatedPrivileges(delegate()
       {SPWeb web = properties.OpenWeb();
        base.ItemAdding(properties);
        string name= web.Lists[properties.ListId].Fields["first name"].InternalName; 
        var list = web.Lists["location names"]; 
  });}
1
source | link

Event Reciever run with elevated previledges

I created one event receiver and deployed it, but only users who are site collection admins are able to view this web part..i have included the SPsecurity.runwithelivatedpriveldeges.but the same thing,.what am i missing?... below is my code

public override void ItemAdding(SPItemEventProperties properties)
   base.ItemAdding(properties);

SPSecurity.RunWithElevatedPrivileges(delegate() {SPWeb web = properties.OpenWeb(); base.ItemAdding(properties); string name= web.Lists[properties.ListId].Fields["first name"].InternalName; var list = web.Lists["location names"]; });}