gpt4 book ai didi

asp.net-mvc - 默认 MVC 项目中的两个 Web.Config 文件

转载 作者:行者123 更新时间:2023-12-02 10:18:10 25 4
gpt4 key购买 nike

我正在探索默认 MVC 5 项目的源代码,发现创建了两个 Web.Config 文件。一个位于项目的根目录中,另一个位于 View 的根目录中。为什么有两个?

最佳答案

The web.config file exists in the Views folders to prevent access to your views by any means other than your controller. In the MVC design pattern, controllers are supposed to route requests and return a rendered view to the calling client. In other words, your view at www.mydomain.com/MySuperController/AwesomeAction1/SweetPage.aspx should not be directly accessible.

What does the Web.Config file do in the views folder of a MVC project

关于asp.net-mvc - 默认 MVC 项目中的两个 Web.Config 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19960130/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com