你可能是包含该控件的类库中的处理程序,然后只用<httpHandlers>
部分注册它在web.config中:
<configuration>
<system.web>
<httpHandlers>
<add verb="*"
path="upload.ashx"
type="MyControl.MyUploadHandler.New, MyControl" />
</httpHandlers>
<system.web>
</configuration>
,如果你使用的是IIS 7集成管道模式到<handlers>
部分:
<system.webServer>
<handlers>
<add name="UploadHandler"
verb="*"
path="upload.ashx"
type="MyControl.MyUploadHandler.New, MyControl" />
</handlers>
</system.webServer>
如果你正在使用ASP.NET 4.0,你可以检出PreApplicationStartMethod infrastructure它允许你动态注册处理程序:
[assembly: WebActivator.PreApplicationStartMethod(typeof(MyControl.StartUp), "PreApplicationStart")]
根据我的经验,需要在异步上传控件旁边安装处理程序文件。难道你不能把它包含在你的客户端软件包中,并说明如何将它安装在适当的地方吗? – mellamokb 2012-07-11 16:20:05