How do you configure the views to able to reference a namespace like System.Web.Mvc without having to do <%@ Import Namespace="System.Web.Mvc" %>? I remember seeing this somewhere but my google skills are failing me at the moment.
Asked
Active
Viewed 3,532 times
1 Answers
21
Can you add them in web.config? Don't know if this works in MVC, though...
<configuration>
<system.web>
<pages>
<namespaces>
<add namespace="Foo.Blop" />
<add namespace="Bar.Whatever"/>
</namespaces>
</pages>
</system.web>
</configuration>
(update - seems to work fine ;-p)

Marc Gravell
- 1,026,079
- 266
- 2,566
- 2,900