我試圖獲取部署的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