I'm trying to add meganav onto a new website, I pretty much copied over the code from an existing working website. But for some reason it doesnt seem to want to work on the new website.
I've created my new partial view and I'm trying to link it into my Master Template using the following;
@{
var homeNode = Model.Content.Site().OfType<Home>();
@Html.Partial("PartialMainNavigation", homeNode.MainNavigation)
}
But I'm getting the following error;
Compiler Error Message: CS0246: The type or namespace name 'Home' could not be found (are you missing a using directive or an assembly reference?)
1) What version of Umbraco are you using?
2) Is Models Builder enabled? If so, what mode is it in? (This can be found in the App Settings of Web Config)
3) What is the document type of your root node? Is it "Home" or is it something different? If it's not got the alias of "home" it won't (I don't think) be mapping to a model of Home.
Meganav error
Hello,
I'm trying to add meganav onto a new website, I pretty much copied over the code from an existing working website. But for some reason it doesnt seem to want to work on the new website.
I've created my new partial view and I'm trying to link it into my Master Template using the following;
But I'm getting the following error;
Compiler Error Message: CS0246: The type or namespace name 'Home' could not be found (are you missing a using directive or an assembly reference?)
Hi Matt,
Couple of questions for you.
1) What version of Umbraco are you using? 2) Is Models Builder enabled? If so, what mode is it in? (This can be found in the App Settings of Web Config) 3) What is the document type of your root node? Is it "Home" or is it something different? If it's not got the alias of "home" it won't (I don't think) be mapping to a model of Home.
Cheers,
Nik
Hello Nik,
Thanks for quick reply;
1) My version is 7.12.1
2) Model Builder is enabled with the following;
3) My document type is indeed "Home"
Thank you.
Hello Nik
Hmm I seem to have fixed it, My Template was called Home Page so I just simply changed it to the following and it worked.
No worries, sometimes it's easy to skip over a name thing. Pleased you've got it sorted now.
is working on a reply...