I'm trying to include a reference to my models in a .net page. I have referred to the models in my Web.Config namespaces tag. Here is the part of my Web.Config where I have referred to the models:
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization"/>
<add namespace="System.Web.Routing" />
<add namespace="LangSiteMvc" />
<add namespace="LangSiteMvc.Models" />
</namespaces>
</pages>
</system.web.webPages.razor>
Here is a screenshot of my models:
But when I try to make my model List<CalendarModel>
Intellisense doesn't recognize it:
However when I add a using statement to the page it does:
I don't want to have to add a using statement to every page that has a model. So why isn't the add namespace
tag working?