我试图获取部署的webpart,并在其中使用带有上传控件的Silverlight webpart。但是,当我访问我的ashx时,在应用程序日志中收到以下错误。SharePoint 2010和ASHX处理程序
Exception information:
Exception type: HttpParseException
Exception message: Could not create type 'FileUploadSP.UploadHandler'.
我有下面的代码的UploadHandler.cs文件:
namespace FileUploadSP
{
public class UploadHandler : RadUploadHandler
{
public override void ProcessStream()
{
base.ProcessStream();
if (this.IsFinalFileRequest())
{
string filename = this.Request.Form["RadUAG_fileName"];
string fullPath = @"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\FileUploadSP\FileTemp\";
SPContext.Current.Web.AllowUnsafeUpdates = true;
FileStream fs = new FileStream(fullPath + filename, FileMode.Open);
SPContext.Current.Web.Files.Add("/UploadLibrary/" + filename, fs, true);
fs.Close();
File.Delete(fullPath + filename);
}
}
}
}
在我.ashx的文件我有以下几点:
%Assembly Name =“Microsoft.SharePoint,Version = 14.0.0.0,Culture = neutral,PublicKeyToken = 71e9bce111e9429c”%> <%@大会名称= “FileUploadSP,版本= 1.0.0.0,文化=中性公钥= 7c8e2c3ef53023ee” %> <%@ WebHandler语言= “C#” 类= “FileUploadSP.UploadHandler” %>
我无法让.ashx按预期工作。我错过了什么?
谢谢!
您可能会在[sharepoint.se] –
得到更好的响应谢谢,我也会在那里发布它。 – PixelMuse