London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
I've also not been able to get model binding for content to work for partials. You can however retrieve the ContentReference using:
Request.RequestContext.GetContentLink()
Hi, I am trying to render meta information on Layout page by returning a PartialView.
These are parts of my pages.
Layout page:
<head>@{ Html.RenderAction("RenderMeta", "Seo"); }</head>
public class SeoController : PartialContentController<IContentData>
{
public ActionResult RenderMeta(SitePageData currentPage)
{
if (currentPage != null)
{
SeoViewModel viewModel = Mapper.Map<ISeoPage, SeoViewModel>(currentPage);
return PartialView("RenderMeta", viewModel);
}
return null;
}
}
where SitePageData : PageData, ISeoInfo
My problem is that RenderMeta is called, but currentPage is null. I am not sure if this is correct SeoController : PartialContentController<IContentData> and if this is correct RenderMeta(SitePageData currentPage)
I can't find any documentation on how to use PartialContentController.