While using SPSecurity.RunWithElevatedPrivileges in your code, Always remember to create your own Spweb/Spsite objects and to never use an object created outside the RunWithElevatedPrivileges scope.
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPWeb web = SPControl.GetContextWeb(Context))
{
//Your Code
}
});
* Advantage of using (SPWeb web ... : Free some Memory!
Tip : SPSecurity.RunWithElevatedPrivileges
Labels:
Tip
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment