Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将视图配置为能够引用 System.Web.Mvc 之类的命名空间而无需执行 <%@ Import Namespace="System.Web.Mvc" %>?我记得在某个地方看到过这个,但我的谷歌技能目前让我失望。
您可以将它们添加到 web.config 中吗?不知道这是否适用于MVC,虽然......
<configuration> <system.web> <pages> <namespaces> <add namespace="Foo.Blop" /> <add namespace="Bar.Whatever"/> </namespaces> </pages> </system.web> </configuration>
(更新 - 似乎工作正常;-p)