locked
Problem in Writing Custom HttpHandler..... RRS feed

  • Question

  • User1039459097 posted

    Hi all,

    For writing custom HttpHandler I have done the following steps:

    1) I wrote a class that Implements IHttpHandler (MyHandler.cs)
    2) Then i wrote the following lines in my Web.Config file:
     
    <configuration>
       <system.web>
           <httpHandlers>
       <add verb="*" path="*.zar" type="Test.MyHandler,Test" />
           </httpHandlers>
       </system.web>
    </configuration> 

    After That i request the following Url (My project Name is Test)
     
      http://LocalHost/Test/Show.zar  (Show.zar file doesn't Exist,only for test )


    But I received the "The page cannot be found" Error.

    What Should i do.? PLease Help Me.

    Sunday, October 2, 2005 5:51 AM

All replies

  • User541108374 posted
    Hi,

    did you also made sure that the .zar file extension is known by the asp_isapi.dll?

    Grz, Kris.
    Sunday, October 2, 2005 6:09 AM
  • User1039459097 posted
    Dear XIII ,hello
    Thanks for your help.you are all right.
    But I fix this problem through IIS and in my local system,What about internet and web server.? i don't access to iis of my Host.
    Should i contact to them or i can programmatically solve this problem.?

    Thanks in advance.
    Best Regards.
    Sunday, October 2, 2005 6:51 AM
  • User541108374 posted
    Hi,

    my guess is that you need to ask it at your hosting company. If they have a strict policy they'll likely not allow it. But first thing would be to ask for it.

    Grz, Kris.
    Sunday, October 2, 2005 7:13 AM
  • User90671449 posted
    It would be easier to just change your web.config to this:

    <configuration>
       <system.web>
           <httpHandlers>
       <add verb="*" path="Show.ashx" type="Test.MyHandler,Test" />
           </httpHandlers>
       </system.web>
    </configuration>

    You can guess the rest right?

    Cheers,
    Wes
    Monday, October 3, 2005 2:52 AM
  • User1039459097 posted

    Dear my Friend...
    Thanks for your help.Isearch your solution in MSDN and found this:

    ....The benefit of this approach is that it simplifies deployment: all you need to do is copy the .ashx file to your virtual directory. There is no need to create or modify a Web.config file or to update IIS—the requisite configuration was done when .NET was installed...


    Once again Thank You & Best Regards.

    Wednesday, October 5, 2005 3:42 AM
  • User541108374 posted
    Hi,

    it's great that you found a solution to your problem. However you mentioned a page on the MSDN site but didn't provide an uri to it. Others might want to see this information also. So please, in the future, always try to give your resources where you found something that helped you out.

    Grz,  Kris.
    Wednesday, October 5, 2005 1:15 PM
  • User1039459097 posted
    Excuse me,Excuse me....Here is Article URL on MSDN Help:

    http://msdn.microsoft.com/msdnmag/issues/02/09/HTTPPipelines/

    Thanks for your advise.
    Regards.
    Wednesday, October 5, 2005 2:50 PM