开发者

deploying a *.ashx file correctly into sharepoint

I have a .ashx file that I have deployed into sharepoint. I want to be able to use the code behind file. Currently I have this setup:

<%@ WebHandler Language="C#" Class="jQueryUploadTest.Upload" %>

using System;
using System.Collections.Generic;
us开发者_JS百科ing System.IO;
using System.Security.AccessControl;
using System.Web;
using System.Web.Script.Serialization;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Workflow;
using IrvineCompany.SharePoint.CLM;

namespace jQueryUploadTest {
.....

I want to be able to put all this code in the code behind file instead of the actual .ashx file. I know I have to change the lines at the top in order to do that, what code would I need in order to make it so I can use the code behind file, and also if I am suppose to add assembly names, how do I find out the full assembly names when i add assemblies.


To use precompiled code, you just need to include the assembly with the classname:

<%@ WebHandler Language="C#" 
Class="jQueryUploadTest.Upload, AssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx" 
%>

To get the strong name, it's usually easiest to grab it from another file in the project. If you can't do that, you can use reflector, look in the GAC properties, or use something like http://www.pvle.be/2010/04/getting-an-assemblys-strong-name-with-powershell/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜