The "GetRenderingHtml" Item Web API action was designed to work only with XSL renderings and not with stand-alone C# components like sublayout (".ascx" user controls) or layouts (".aspx", ".cshtml" pages).
You can see from the implementation of the "Sitecore.ItemWebApi.Actions.GetRenderingHtmlAction" class using a decompiler that it just runs the "getRenderingPreview" pipeline with specified arguments.
public override void Process(HttpContext httpContext)
{
Assert.ArgumentNotNull(httpContext, "httpContext");
httpContext.Response.Clear();
httpContext.Response.DisableCaching();
if (!this.IsAccessAllowed())
{
httpContext.Response.StatusCode = 0x193;
httpContext.Response.End();
}
else
{
string previewHtml = RenderingPreviewProvider.GetPreviewHtml();
httpContext.Response.ContentType = "text/html";
httpContext.Response.Write(previewHtml);
httpContext.Response.Flush();
}
}
GetPreviewHtml looks like:
public static string GetPreviewHtml()
{
Database database = GetDatabase();
Language language = Context.Language;
Item renderingItem = GetRenderingItem(database, language);
Item sourceItem = GetSourceItem(database, language);
string parameters = GetParameters();
RenderingReference reference = new RenderingReference(renderingItem) {
Settings = {
DataSource = sourceItem.ID.ToString(),
Parameters = parameters
}
};
GetRenderingPreviewArgs args = new GetRenderingPreviewArgs(renderingItem, sourceItem);
CorePipeline.Run("getRenderingPreview", args);
return args.Result;
}