我可以在ASP.NET中禁用#include吗?

Gav*_*ler 1 asp.net file include

我一直无法使用谷歌找到任何东西...如果我在我的ASP.NET代码页上写:

<!-- #include file="file_to_include.aspx" -->
Run Code Online (Sandbox Code Playgroud)

该文件输出到页面.如何禁用此行为?


#include服务器端包含(SSI)的 MSDN信息

Geo*_*ker 5

甚至更新的回答 现在更多的Cowbell!

事实证明,您可以在IIS 的Web服务扩展管理器中禁用服务器端包含: 替代文字

只需选择Server Side Includes并单击Prohibit按钮即可.

回答#2 更新答案:

如何在IIS中禁用服务器端包含


老答案

如果您使用服务器端注释,那应该有效.

试试这个:

<%--  <!-- #include file="file_to_include.aspx" --> --%>
Run Code Online (Sandbox Code Playgroud)