积极答复者
关于web.config pages/namespaces 配置节点

问题
-
<pages> <namespaces> <add namespace="System.Data"/> <add namespace="System.Data.SqlClient"/> </namespaces> </pages>
理论上在web.config中加入以上配置后,在aspx.cs中的using部分中,都不需要添加上面两个命名空间。但实际上是,这样却并没有效果。
这个问题我几年前就问过,到现在也一直没有解决。以前用vb.net的时候是可以的。
请问哪位朋友知道解决这个问题,每新建一个aspx就要using很多namespace太麻烦了。
- 已移动 Lisa Zhu 2012年12月20日 2:21 asp related (发件人:Visual C#)
答案
-
你好,
这种设置只能针对前台的aspx,对后台没用的。这个是asp.net2.0之后引入的。所以你还是要在后台.cs文件中加入using的。
Roy
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- 已标记为答案 Song TianModerator 2012年12月25日 8:29
全部回复
-
你好,
这是一个ASP.NET的相关问题,所以将其移到ASP.NET AJAX 中文论坛,以便让你获得更好的支持。
感谢你的理解与支持。
Lisa Zhu [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
你好,
这种设置只能针对前台的aspx,对后台没用的。这个是asp.net2.0之后引入的。所以你还是要在后台.cs文件中加入using的。
Roy
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- 已标记为答案 Song TianModerator 2012年12月25日 8:29