I use @inherits Umbraco.Web.Mvc.UmbracoTemplatePage, which works fine for me. You shouldn't need to add any references if your view are in the same website as Umbraco (and assuming you are using a website rather than web application as they are termed in Visual Studio).
If you are still having trouble, try qualifying it with the global namespace: @inherits global::Umbraco.Web.Mvc.UmbracoTemplatePage.
Also, FYI, Umbraco.Web.Mvc.UmbracoTemplatePage exists in the assembly umbraco.dll.
Jan - Actually the cheatsheet I am looking at says at the top "Umbraco v6.x Razor Cheatsheet", so it is the correct one.
Nicholas - I am using "@inherits Umbraco.Web.Mvc.UmbracoTemplatePage" because that is what was put there when I created the template via the UI. It is working, but I am trying to learn the Umbraco MVC stuff, so took a look at these. Checked out umbraco.dll and see the umbraco.web..
inherits ???
These all say to use
@inherits Umbraco.Core.Mvc.UmbracoTemplatePage
but when I create a template in Umbraco UI it uses:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
if I try to change the Web to Core, then it errors:
The type or namespace name 'Mvc' does not exist in the namespace 'Umbraco.Core' (are you missing an assembly reference?)
Yes I am including Umbraco.Core as a reference, I don't even see any Mvc in Umbraco.Core.
(looking at v6.1.6 )
Hi Karen
You should use the namespace that Umbraco creates by default when creating a template.
The cheat sheet you're looking at is for Umbraco 4.7.1 - The one you should look at is this one for 6.1.x http://our.umbraco.org/projects/developer-tools/umbraco-v6-mvc-razor-cheatsheets
Hope this helps.
/Jan
I use @inherits Umbraco.Web.Mvc.UmbracoTemplatePage, which works fine for me. You shouldn't need to add any references if your view are in the same website as Umbraco (and assuming you are using a website rather than web application as they are termed in Visual Studio).
If you are still having trouble, try qualifying it with the global namespace: @inherits global::Umbraco.Web.Mvc.UmbracoTemplatePage.
Also, FYI, Umbraco.Web.Mvc.UmbracoTemplatePage exists in the assembly umbraco.dll.
Hi
Jan - Actually the cheatsheet I am looking at says at the top "Umbraco v6.x Razor Cheatsheet", so it is the correct one.
Nicholas - I am using "@inherits Umbraco.Web.Mvc.UmbracoTemplatePage" because that is what was put there when I created the template via the UI. It is working, but I am trying to learn the Umbraco MVC stuff, so took a look at these. Checked out umbraco.dll and see the umbraco.web..
Thanks.
Hi Karen
Aaah, it's just because the path of this post links to the 4.7 cheatsheet so I thought it was perhaps the wrong one. My bad :)
/Jan
You are right! I didn't even realize I was posting this in the wrong place.
Hmm, looks like the other one doesn't even have a forum. Oh well!
Thanks for looking :)
is working on a reply...