asp.net - How do you set handler mapping to a directory in IIS 6.0? -


I have IIS 7.0 on my development machine and IIS 6.0 on my server. On my development machine, I was able to set a handler map on a directory inside my viewer / viewHtml and I mapped it on ASP.NET. In my global.asax I check the request sent to asp.net / viewHtml / and I serve the appropriate HTML file (HTML version of the doctor, power point or Excel file) located outside this application virtual directory. I am doing it this way because all files are protected, we did not want to keep these files in the database due to scalability, and I have to hide the path of these files on the server. In IIS 7.0, all this does work out how I really like it. Although I can not configure my IIS 6.0 server to map all requests to ASP.NET in that directory.

Any thoughts? Thanks guys?

I have installed a web application using the same configuration that you are using and I Getting 404 I do not know why it works in IIS 7, but what I had to do to fix it.

Create a class that enforces the system. Web.IHttpHandler class. Transfer the code from Application_BeginRequest to the implementation of IHttpHandler.ProcessRequest.

Now you just have to register your HTML handler with ASP.NET. Do this to your web In the Configure, add an entry to /configuration/system.web/httphandlers.

Web.config Example:

  ... & lt; HttpHandlers & gt; & Lt; Clear /> & Lt; Action = "*" path = "*" type = "namespace classname, assembly name" /> Add & lt; / HttpHandlers & gt; ...  

This entry is telling ASP.NET to handle HTTP requests with any extension and any HTTP method by running the code in your HTTP hander. Note that I am clearing all the first definded handlers (defined in the web.config of the machine).

Note that application mappings configured in IIS will be required.


Comments

Popular posts from this blog

How to Create Master-Details view using Asp.Net MVC framework -

delphi - Mouseover hint for TChart series value -

c++ - Linux and clipboard -