Just wondering if this is at all possible. I have the below method which works fine, but my issue is calling an Html.RenderAction within this page, that inherits the page Model, to bring back data from the DocumentType.
public class EventsController : Umbraco.Web.Mvc.RenderMvcController
{
public EventsController()
{
public ActionResult Index(ContentModel model)
{
var eventsViewModel = new EventsViewModel(model.Content)
{
}
return CurrentTemplate(eventsViewModel);
}
}
}
public class EventsViewModel : PublishedContentWrapped
{
public EventsViewModel(IPublishedContent content) : base(content) { }
}
Somehow, I need to get the Model data, from the above page, into this below ActionResult
public class CMSEventsController : Umbraco.Web.Mvc.SurfaceController
{
public ActionResult GetLatestEvents(String partialView)
{
var latestEventsViewModel = new LatestEventsViewModel()
{
};
return PartialView($"~/Views/Partials/{partialView}", latestEventsViewModel);
}
}
I call the below on the main Events page.
@{
Html.RenderAction("GetLatestEvents", "CMSEvents", new { partialView = "_LatestEvents.cshtml" });
}
Route Hijack with PartialView
Good Morning,
Just wondering if this is at all possible. I have the below method which works fine, but my issue is calling an Html.RenderAction within this page, that inherits the page Model, to bring back data from the DocumentType.
Somehow, I need to get the Model data, from the above page, into this below ActionResult
I call the below on the main Events page.
I probably haven't explained this very well!!
Best Regards
is working on a reply...