views:

399

answers:

1

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.

+7  A: 

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