How do I restrict access to files with specific extensions in ASP.NET?

后端 未结 2 671
一整个雨季
一整个雨季 2020-12-16 18:48

I have in my web application an ADO.NET Entity-Framework *.edmx file.

When I browse in the browser (when the application is running) to an edmx file, it doesn\'t sho

2条回答
  •  天涯浪人
    2020-12-16 19:04

    You should map the extension to the ASP.NET's System.Web.HttpForbiddenHandler class in web.config. If you are using IIS6, before you could do that, you should have mapped the extension to ASP.NET ISAPI handler.

    IIS7 Integrated Mode:

    
        
            
        
    
    

    IIS7 Classic Mode. Something like:

    
      
         
      
    
    
      
         
      
    
    

    IIS6 (after mapping the handler to aspnet_isapi.dll in IIS6 configuration):

    
      
         
      
    
    

提交回复
热议问题