Last post Oct 29, 2014 05:35 AM by Mikesdotnetting
Oct 29, 2014 05:09 AM|Gaurav Balyan|LINK
Dear, Can you please tell me how can i use HTTPHandler in my application , i am just creating for testing it but i am confused in that if i have to register it in Isapi_dll,what i am doing currently is,
i am writing this code in a class file,
public class ImgHandler : IHttpHandler
public void ProcessRequest(HttpContext context)
context.Response.Write("Hello From Handler");
public bool IsReusable
and this code in web.config file,
<add name="MyImageHandler" verb="*" path="*.aspx" type="WebApp.ImgHandler"/>
Please suggest me if i am doing anything wrong.
Oct 29, 2014 05:13 AM|Mikesdotnetting|LINK
i am confused in that if i have to register it in Isapi_dll
No you don't.
If you use a Generic Handler (ashx file) you don't even need to add an entry in web.config.
For more information, see this: HTTP Handlers and HTTP Modules Overview
Oct 29, 2014 05:23 AM|Ajay230784|LINK
Try Changing following
<add name="MyImageHandler" verb="*" path="*.aspx" type="ImgHandler"/>
Also following article will be usefull for you,
Oct 29, 2014 05:30 AM|Gaurav Balyan|LINK
I tried the link but after adding the line,
<add verb="*" path="*.cspx" type="CspxHandler"/>
i am getting the error this page cannot be displayed.
Oct 29, 2014 05:35 AM|Mikesdotnetting|LINK
You need to register that. It's a custom handler. Check the article I linked to.