Developer forum

Forum » Development » Generic handlers in Dynamicweb

Generic handlers in Dynamicweb


Reply
I'm implementing a custom module. In this, I want to be able to use a handler. But no matter what, I receive a 404, when I try accessing this ashx-file.

How can I use handlers in Dynamicweb?

Replies

 
Nicolai Høeg Pedersen
Reply
It is possible - simply register it in web.config.

But in 19.0.3.1 there is a change of behaviour with search friendly urls that introduced an issue with .ashx files if they where routed to somewhere in /Admin. That was solved with 19.0.3.2 - so now they can be placed anywhere.

So how do you register it, and to what location?
 
Nicolai Høeg Pedersen
Reply
btw - it could be a http compression issue - so try disabling http compression for .ashx files in web.config or add ?compress=false to you .ashx request.
 
Reply
Hi,

I have placed a file called metadata.ashx in the root of Dynamicweb. I haven't registered it in web.config as it shouldn't be necessary.

I have just tried to upgrade to the latest version of DW and also removed compression. However, to no avail. Do I need to alter something in Dynamicweb itself?
 
Nicolai Høeg Pedersen
Reply
No need for changing things in DW.

What happens if you have a .ashx - by any chance have a link?
 
Reply
Sorry, it is a local project. I can try publishing the solution to a public server.

Dynamicweb responds with a Dynamicweb 404-page.
 
Reply
Hi,

I have created generic handler in my custom modules project and placed it in root folder of the Dynamicweb (root folder of the site). And all works fine (httpcompression - enabled, web.config - not changed).

Could you answer following questions:
1. Where did you place the .ashx file?
2. What version of Dynamicweb are you using?
3. Do you use Customized urls?

Thanks
 
Reply
Hi,

Yup, I also just tried inserting a test handler, and it works just fine.

I then started debugging my custom handler, and I found out that there was a bug in this. Sorry, for any inconvenience....

Peter

 

You must be logged in to post in the forum