Hi, wonder if someone can help me with this error:
I am trying to submit a form and then after the submit to update a column using the code below, however I am getting the following error:
"The OnSubmitRequest event handler did not work" and in the details was this error "Could not load file or assembly 'Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified." but when I run it on the SP server it runs fine ... only when I run it from outside the server I get the above mentioned errors.
Any ideas? suggestions?
Thanks
Steve
SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPWeb site = new SPSite("http://serverurl/").OpenWeb();
SPFolder folder = site.GetFolder("Multi Form Approval");
SPFileCollection files = folder.Files;
try
{
foreach (SPFile file in files)
{
if (file.Item.Name == fileName.Trim() + ".xml")
{
file.Item["Manager Name"] = managerName;
site.AllowUnsafeUpdates = true;
file.Item.Update();
site.AllowUnsafeUpdates = false;
}
}
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
});
// If the submit operation is successful, set
e.CancelableArgs.Cancel = false;
// Write your code here.
}