Question

I am trying to integrate the FileUpload project from vid.ly to my web application which is in MVC ASP .NET 4 framework using Razor engine.

I have an HttpHandler under App_Code. Progress.cs

public class Progress : IHttpHandler
{
 ...
}

I added this in RegisterRoutes() called from Globals.asax:

routes.IgnoreRoute("Progress.progress");

And added these lines in system.web section in web.config:

<httpHandlers>
    <add verb="*" path="*.progress" type="MyNamespace.Progress"/>
</httpHandlers>

When I try to open http://localhost:39234/Progress.progress, I get a HTTP Error 404.0 - Not Found error with below detailed information:

Requested URL      http://localhost:39234/Progress.progress
Physical Path      c:\users\xxxxx\documents\visual studio 2012\Projects\SolutionName\ProjectName\Progress.progress

Seems like something is wrong with the mapping. Does anyone have any idea what I'm missing?

Was it helpful?

Solution

I finally figured out what the problem was. I had to put the mappings in system.webServer section in this format:

<add name="Progress" verb="*" path="*.progress" type="MyNamespace.Progress,MyNamespace"/>

Or, set the Action Build Path to "Content" for the Progress.cs files so that it doesn't get compiled in the MyNamespace.dll

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top