If your code modifies Windows SharePoint Services data in some way, you may need to allow unsafe updates on the Web site, without requiring a security validation. You can do by setting the AllowUnsafeUpdates property.
C#:
using(SPSite mySite = new SPSite(<Server URL>))
using(SPWeb myWeb = mySite.OpenWeb()) {
myWeb.AllowUnsafeUpdates = true;
SPList interviewList = myWeb.Lists[<ListName>];
SPListItem newItem = interviewList.Items.Add();
newItem[<ColumnName>] = "interview";
newItem.Update(); }
No comments:
Post a Comment