English 中文(简体)
ASP.NET HttpHandler and WebResource.axd issues
原标题:

I need a simple HttpHandler to handle specific non-existant paths in my ASP.NET project. I m using sitefinity 4. I wrote the handler but whenever I try to run the site, I get a frustrating error

The WebResource.axd handler must be registered in the configuration to process this request.

I was putting the handler in the system.web part of the config but it looks liek VS2010 still uses IIS 6 for it s built in web server so I went ahead and switched it to use IIS 7 (local) and moved the registration of the handler to system.webServer and it works when I hit a non existant url but if I try to go to the site normally (valid url) I get that dang error again.

It worked once, giving me the correct site on a valid url but now it just continues to give me trouble.

How can I resolve this issue? I don t want to add that entry to the config as it wasn t there when I created the project and it only started when I added my handler.

EDIT: Only happens when I use Path="*" so how do I do a wildcard? I don t want to map a handler to catch a 404 page.

最佳回答

Froget it. No one seems to know even though I know i m not the only one who has needed to do this. I got 404 to work but ONLY when I request a file, not a folder so thats a bust.

I found that Global.asax will hit under integrated mode so I just moved my code to the Application_BeginRequest() and it s working just fine. If anyone else has a better answer I will give them credit.

问题回答

for iis7 and iis7.5, handlers are registered in system.webserver. the httphandlers and httpmodules in system.web are ignored and are used for IIS 6 and classic mode.

i hope this was helpful!





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签