c# - Trigger HttpHandler on specific URL -


I have created a HttpHandler , which I request from a specific URL in the browser.

I tried to register it like this:

  & lt; System.webServer & gt; & Lt; Operators & gt; & Lt; Clear /> & Lt; Add name = "png" verb = "GET, HEAD" path = "* .png" type = "MyProject.HttpHandler" /> & Lt; Add name = "jpg" verb = "gET, HEAD" path = "* .jpg" type = "MyProject.HttpHandler" /> & Lt; Add name = "jpeg" verb = "GET, HEAD" path = "* .jpeg" type = "MyProject.HttpHandler" /> & Lt; Add name = "gif" verb = "GET, HEAD" path = "* .gif" type = "MyProject.HttpHandler" /> & Lt; / Operators & gt; & Lt; System.webServer & gt;  

This works on all the URLs, except that I have to work for it. I want to handle the request when the browser makes a request for the image. It looks like:

http://example.net/contentassets/some_image_name.jpg?maybe=someParameters

For some reason http handler < / Code> is not picking those people, in fact I want to use the http handler > requests to http: //example.net/contentassets/ ... So that they only if in the contentassets url). Does anyone know this?

EDIT: Do the handler ignore the query string?

EDIT2: We use the EMI server as a CMS, so the images are obtained from the EPI server blob storage. The storage is inside the project folder. This may be a problem maybe.

The path element looks like a mask, you have tried:

  & Lt; Add name = "png" verb = "GET, HEAD" path = "* / contentassets / * .png" type = "MyProject.HttpHandler" />  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -