什么是Web.config中的System.Web程序/页/命名空间标签的意义呢? [英] What's the point of the Web.config's system.web/Pages/Namespaces Tag?
问题描述
不管我的机器的根Web配置(一个在Windows / Microsoft.NET / ...)是否包含的System.Web /页/命名空间/添加
元素,它仍然要求我包括使用说明上面各aspx.cs codeBehind文件。为什么?不应该把它编译,而不是抱怨它无法理解一个页面是什么?毕竟,&LT;添加命名空间=System.Web程序/&GT; <!/ code>存在于根web.config
Regardless of whether my machines's root web config (the one in Windows/Microsoft.NET/...) contains system.web/pages/namespaces/add
elements, it still is demanded that I include using statements atop each aspx.cs CodeBehind file. Why? Shouldn't it compile and not complain that it cannot understand what a Page is? After all, <add namespace="System.Web" />
exists in the root web.config!
推荐答案
的的System.Web /页/命名空间/添加
元素是。 ASPX
文件,正常值 .CS
文件(包括 .ASPX.CS
)仍然需要做正确的使用
因为有编译前的源没有pre-处理。因此, .ASPX.CS
必须是有效的CS文件包括所有的使用命名空间
声明。
The system.web/pages/namespaces/add
element is for .ASPX
files, normal .CS
files (including .ASPX.CS
) still need to do proper using
as there is no pre-processing of the source before compilation. So .ASPX.CS
must be valid CS file including all using Namespace
declarations.
这篇关于什么是Web.config中的System.Web程序/页/命名空间标签的意义呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!