Skip to content

Instantly share code, notes, and snippets.

@csharpforevermore
Created April 9, 2015 15:48
Show Gist options
  • Save csharpforevermore/699d4ba0cbc11064f170 to your computer and use it in GitHub Desktop.
Save csharpforevermore/699d4ba0cbc11064f170 to your computer and use it in GitHub Desktop.
Get UmbracoApiController URL
@{
RequestContext requestContext = HttpContext.Current.Request.RequestContext;
UrlHelper urlHelper = new System.Web.Mvc.UrlHelper(requestContext);
string apiControllerUrl = urlHelper.GetUmbracoApiService<CamMonController>(x => x.CreateCampaignForNodeId(123));
}
<h1>Example Link</h1>
<a href="@(apiControllerUrl)">LINK</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment