HttpHandlers?

wtbonnell

Freshman
Joined
Oct 6, 2003
Messages
32
Problem: I have an .xml file that users can read and write through code (C#.Net), however, I do not want them being able to view the .xml file when they type it in the URL field of the web browser.

Solution: I researched a possible way of solving this by using the httpHandlers. In the web.config file I would put the following:

Code:
<httpHandlers>
<add verb="*" path="*.xml"type="YourNamespace.YourHttpHandler"/>
</httpHandlers>

Then I am suppose to write a new IHttpHandler class that will write a 404 error when a user tries to access the .xml file virtually (but I am unsure how to write this class...are there any good examlpes out there or has someone done this already that may be able to fill in the empty gaps?)

Thanks for your help...
 
Back
Top