HttpHandler - Passing a parameter

S

shapper

Hello,

I created an HttpHandler class, compiled it and tested it. It works
fine.
I added an HttpHandler in my web.config file as follows:

<httpHandlers>
<add verb = "*" path="MyHandler" type="MyNM.SiteMap, MyNM" />
</httpHandlers>

However, I now need to pass a parameter to my handler. I tried the
following:
<httpHandlers>
<add verb = "*" path="MyHandler?Id=1" type="MyNM.SiteMap, MyNM" />
</httpHandlers>

I am getting the 404 error. Page Not Found.

If this is not possible, how can I pass parameters to an HttpHandler?

Thanks,
Miguel
 
K

Karl Seguin [MVP]

<httpHandlers>
<add verb = "*" path="MyHandler.adx" type="MyNM.SiteMap, MyNM" />
</httpHandlers>


then when you hit myhandler.adx you can pass any parameters you want:

<img src="myhandler.adx?imageId=3">

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top