GetGridHtml - Can I get html for a versioned page?
Hi,
I have a bit of code that I am playing around with and I wondered if it was possible to get the HTML markup of the page?
The code is:
IContentService cs = ApplicationContext.Current.Services.ContentService;
IContent specificVersion = cs.GetByVersion(versionId);
var currentPageId = 1079;
var umbracoHelper = new UmbracoHelper(Umbraco.Web.UmbracoContext.Current);
IPublishedContent content = umbracoHelper.TypedContent(currentPageId);
IPublishedContent currentPage = Extensions.ContentExtensions.ToPublishedContent(specificVersion, true);
var tt = content.GetGridHtml("gridAlias", "gridRenderer");
But the last line var tt - I have no idea if it is possible to GetGridHtml - it seems like I need to pass in HtmlHelper but I need help setting this up.
GetGridHtml - Can I get html for a versioned page?
Hi,
I have a bit of code that I am playing around with and I wondered if it was possible to get the HTML markup of the page?
The code is:
But the last line var tt - I have no idea if it is possible to GetGridHtml - it seems like I need to pass in HtmlHelper but I need help setting this up.
Any ideas?
The currentPage = Extensions snippet is from a previous ticket: https://our.umbraco.org/forum/using-umbraco-and-getting-started/86540-render-page-as-html-using-a-page-version-guid
Jon
I don't know how to do it for your specific case but to render grid you normaly need:
Where template is a partialview in the Views/Partials/Grid folder.
is working on a reply...