为什么有2 web.config文件中 [英] why are there 2 web.config files

查看:112
本文介绍了为什么有2 web.config文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人给我发过链接下载样本标准asp.net MVC示例,我注意到,有2 web.config文件中:

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

  2. 在views目录
  3. 1

是什么原因?

推荐答案

在浏览目录中的web.config文件只是有一个显著条目,阻止直接访问:

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

<add path="*" verb="*"
      type="System.Web.HttpNotFoundHandler"/>

这是所以有人不能手动尝试到 http://www.yoursite.com/views/main/index.aspx 并加载MVC以外的页面管道。

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.

这篇关于为什么有2 web.config文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆