why are there 2 web.config files

后端 未结 4 885
轮回少年
轮回少年 2020-12-29 03:27

Someone sent me over a link to download the sample standard asp.net MVC sample, I noticed that there were 2 web.config files:

  1. 1 in the root directory
4条回答
  •  灰色年华
    2020-12-29 04:04

    The web.config in the Views directory just has one significant entry, which blocks direct access:

    
    

    This is so someone cannot manually try to go to http://www.yoursite.com/views/main/index.aspx and load the page outside the MVC pipeline.

提交回复
热议问题