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
As the title says...
My guess would be that UmbracoTemplatePage is for partial views since there are less properties exposed but I don't really know what the underlying ideology is.
UmbracoTemplatePage is mostly a convenience, it is the same as UmbracoViewPage<RenderModel> except it also has the CurrentPage dynamic property which is the dynamic model of Model.Content
Trying to summarize the differences:
UmbracoViewPage<TModel> : WebViewPage<TModel>UmbracoViewPage : UmbracoViewPage<IPublishedContent>
UmbracoTemplatePage : UmbracoViewPage<RenderModel>UmbracoTemplatePage<TContent> : UmbracoViewPage<RenderModel<TContent>>
All of them have the same Umbraco helper, etc. so Umbraco.Field(...) will work with both.
UmbracoTemplatePage model is a RenderModel (having a Content property which is of type IPublishedContent) or a RenderModel<TContent> (having a Content property which is of type TContent). So Model.Content is a strongly-typed content. In addition, UmbracoTemplatePage adds a CurrentPage property which is a dynamic.
UmbracoViewPage is clever: depending on whether your view inherit from UmbracoViewPage<IPublishedContent> or UmbracoViewPage<RenderModel>> the model will be directly the IPublishedContent, or a RenderModel instance.
Now which one should one use?
In my mind, if you don't plan on using the dynamic CurrentPage property then using UmbracoViewPage makes sense, and then Model is your current content. OTOH if you want the dynamic CurrentPage property, you'll want UmbracoTemplatePage. And the generic versions are for future usage, when we'll be able to use UmbracoViewPage<NewsItem> where NewsItem would be a strongly-typed implementation of IPublishedContent corresponding to content type "news item" -- but that is not working at the moment in 7.1.
Thanks for that guys. Much clearer now.
below link will be helpful
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted