Have a read of this blog post that explains how to use MVC layouts on Webforms pages: https://blog.horizontalintegration.com/2015/09/15/mixing-sublayout-with-rendering-webforms-with-mvc-request/. It references a couple of examples such as the one you mentioned.
The solution consists of a Extension Method for the Sublayout:
public static class SubLayoutExtension
{
public static string RenderSublayoutHTML(this Sublayout subLayout)
{
string retHTML = string.Empty;
var page = new DummyPage();
if (HttpContext.Current.Items.Contains("ismvc"))
{
var userControl = page.LoadControl(subLayout.Path);
subLayout.Controls.Add(userControl);
}
page.Controls.Add(subLayout);
retHTML = ExecutePage(page);
return retHTML;
}
private static string ExecutePage(DummyPage page)
{
page.ProcessRequest(HttpContext.Current);
return page.Result;
}
}
You can then call it like so:
var item = e.Item.DataItem as Item;
if (item == null) return;
var slideImage = e.Item.FindControl("slideImage") as Literal;
if (slideImage == null) return;
Sublayout slideSublayout = new Sublayout();
slideSublayout.DataSource = item.Paths.FullPath;
if (item.TemplateID.Equals(new ID(ImageSlideItem.TemplateId)))
{
slideSublayout.Path = "~/Common/Sublayouts/PageElements/Image/Image.ascx";
}
else if (item.TemplateID.Equals(new ID(VideoSlideItem.TemplateId)))
{
slideSublayout.Path = "~/Common/Sublayouts/PageElements/Video/HostedVideo.ascx";
}
else if (item.TemplateID.Equals(new ID(YouTubeVideoSlideItem.TemplateId)))
{
slideSublayout.Path = "~/Common/Sublayouts/PageElements/Video/YouTubeVideo.ascx";
}
slideImage.Text = slideSublayout.RenderSublayoutHTML();
As referenced in the article this is another way of doing it, using MVC pages and views and rendering user controls within them instead: http://bisstalk.blogspot.co.uk/2014/10/sitecore-sublayouts-rendering-on.html
Hopefully this is useful.