SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPSite sps = new SPSite("http://test:1659/");
SPWeb impersonateweb = sps.OpenWeb();
impersonateweb.AllowUnsafeUpdates = true;
SPList _spListAanwezige = impersonateweb.Lists["Survey"];
_spListAanwezige.EventReceivers.Add(SPEventReceiverType.ItemAdded,
"ReplicateData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1f0faf7eec29149f", "ReplicateData.SurveyEventHandler");
impersonateweb.AllowUnsafeUpdates = false;
});
No comments:
Post a Comment