Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi, I am new to Umbraco so I hope the below make sense.
I am getting this error when loading my page
"The type or namespace name 'InternalCommsVideo' could not be found (are you missing a using directive or an assembly reference?)"
The page template itself calls a partial view like this
@foreach (IPublishedContent sectionItem in Model.Content.Content) { @Html.Partial("NestedInternalComms/_" + sectionItem.DocumentTypeAlias, sectionItem); }
The partial view then has the following import statements at the top
@inherits Umbraco.Web.Mvc.UmbracoViewPage<InternalCommsVideo> @using Umbraco.Web.PublishedContentModels;
This appears to be the same pattern the rest of my pages are set up with.
I am able to see the InternalCommsVideo within App_Data/Models so I am not sure why I am getting this error.
Can anyone please help? If you need further information please let me know.
Thanks
Hello Sam,
Try to follow these steps :-
-Clean solution
-Delete all "bin" and "obj" Folders (from the whole solution) manually
-Restart VS
-Rebuild all
Hi, just tried this suggestion but unfortunately still the same error
try referencing InternalCommsVideo using it's namespace
like below 9using whatever your models namespace is
Vantage.Models.InternalCommsVideo
Hi Huw,
Just tried this aswell, but unfortunately still getting the same error
What are your models builder settings?
The below is current set in web.config
<add key="Umbraco.ModelsBuilder.Enable" value="true" /> <add key="Umbraco.ModelsBuilder.ModelsMode" value="AppData" />
Ok think I have now resolved this issue.
When creating the document type and partial view through backoffice the .cshtml and generated .cs files were not being added to the project and .csproj.
After going into Visual Studio and adding them to the project everything seems to work ok.
Not sure if this is normal behaviour or not.
It is :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Issue with partial view inheriting model
Hi, I am new to Umbraco so I hope the below make sense.
I am getting this error when loading my page
"The type or namespace name 'InternalCommsVideo' could not be found (are you missing a using directive or an assembly reference?)"
The page template itself calls a partial view like this
The partial view then has the following import statements at the top
This appears to be the same pattern the rest of my pages are set up with.
I am able to see the InternalCommsVideo within App_Data/Models so I am not sure why I am getting this error.
Can anyone please help? If you need further information please let me know.
Thanks
Hello Sam,
Try to follow these steps :-
-Clean solution
-Delete all "bin" and "obj" Folders (from the whole solution) manually
-Restart VS
-Rebuild all
Hi, just tried this suggestion but unfortunately still the same error
try referencing InternalCommsVideo using it's namespace
like below 9using whatever your models namespace is
Vantage.Models.InternalCommsVideo
Hi Huw,
Just tried this aswell, but unfortunately still getting the same error
What are your models builder settings?
The below is current set in web.config
Ok think I have now resolved this issue.
When creating the document type and partial view through backoffice the .cshtml and generated .cs files were not being added to the project and .csproj.
After going into Visual Studio and adding them to the project everything seems to work ok.
Not sure if this is normal behaviour or not.
It is :)
is working on a reply...