Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

 

<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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...