Is it possible to group namespaces in one file in ASP.NET MVC?
asp.net, asp.net-mvc, asp.net-mvc-3, c#
Solution
You can add namespaces to your web.config under `system.web/pages/namespaces`
http://msdn.microsoft.com/en-us/library/ms164642.aspx
<system.web>
<pages>
<namespaces>
<add namespace="System.SomeNamespace" />
</namespaces>
</pages>
</system.web>
Adding them here has the effect of adding these namespaces to all pages/views.
Problem
I have more than 10 files (Views) which many of them use common namespaces (almost 5-6 at number). It's difficult to manage namespaces for all files and I thought at grouping namespaces in one file and insert that file in each View, means one line instead of 5-6 lines of namespace. How to do that ? With Partial View, I guess that is not possible. What is the good way to group namespaces in one file ? Thank you