SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm reading a parameter from the url in a site. Then i insert that data in a survey list, but that event receiver only works for administrator, when i use another user i cannot insert that data. I already use elevate privileges. Can you help me with my problem.

share|improve this question
could you show some code? – David Lozzi Dec 17 '12 at 14:51

How are you elevating your code?

Are you instatiating you site object elevated or are you using the context one ?


     using(SPSite site = new SPSite(yoursiteid))
         //site is elevated
     SPSite site2 = SPContext.Current.Site;
     //site2 is not elevated
     //beacuse is a receiver you might be using 
     SPSite site3 = properties.Feature.Parent as SPSite;
     //in this case site3 is also not elevated as you are reusing an existint instance
     //you could do this from the feature receiver (all this assuming that is a Site collection feautre) hence casting the Feature.Parent as SPSite
     using(SPSite site4 = new SPSite(site3.ID))
        //site4 is and new instance and will be elevated

Hope this helps

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.