Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Error while settingAllowunsafeupdates property

  Asked By: Demarco    Date: Aug 09    Category: Sharepoint    Views: 963

I am receiving the following error while setting the allowunsafeupdates
of the spweb object to true. System.Security.SecurityException: Request
for the permission of type Micros oft.SharePoint.Security.SharePointPermission,
Microsoft.SharePoint.Security, Version=, Culture=neutral,
PublicKeyToken=71e9bce111e9429c failed. at
ignoreGrants, TokenBasedSet grants, TokenBasedSet denied, TokenBasedSet dem
ands) at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionS et
grants, PermissionSet denied, PermissionSet demands) at Microsoft.SharePo
int.SPWeb.a(Boolean A_0) at Microsoft.SharePoint.SPWeb.set_AllowUnsafeUpdate
s(Boolean value) following is the line of code where error occurs. SPWeb web
= SPControl.GetContextWeb(HttpContext.Current); web.AllowUnsafeUpdates = true;
-- error occurs here How to solve this?



No Answers Found. Be the First, To Post Answer.

Didn't find what you were looking for? Find more on Error while settingAllowunsafeupdates property Or get search suggestion and latest updates.