HttpHandler - Passing a parameter

  • Thread starter Thread starter shapper
  • Start date Start date
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
 
<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
 
Back
Top