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.
The System. Web. Mvc namespace contains classes and interfaces that support the ASP.NET Model View Controller (MVC) framework for creating Web applications. This namespace includes classes that represent controllers, controller factories, action results, views, partial view, model binders, and much more.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With