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:

    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
        <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" />

Here is a screenshot of my models: enter image description here

But when I try to make my model List<CalendarModel> Intellisense doesn't recognize it:

enter image description here

However when I add a using statement to the page it does: enter image description here

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?

Related posts

Recent Viewed