Skip to content

Instantly share code, notes, and snippets.

@jamiepollock
Created January 26, 2017 19:12
Show Gist options
  • Save jamiepollock/d0345ad62572e85a954aeed3e4217895 to your computer and use it in GitHub Desktop.
Save jamiepollock/d0345ad62572e85a954aeed3e4217895 to your computer and use it in GitHub Desktop.
In Theory (TM)! How to return an Umbraco Form HTML from an ApiController
using System.Web;
using Umbraco.Web.WebApi;
namespace My.Website.Controllers.Api
{
public class FormHtmlApiController : UmbracoApiController
{
public IHtmlString Get(string id)
{
return Umbraco.RenderMacro("FormsRenderForm", new { FormGuid = id });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment