Skip to content

Instantly share code, notes, and snippets.

@csharpforevermore
Created October 25, 2013 11:40
Show Gist options
  • Save csharpforevermore/7153352 to your computer and use it in GitHub Desktop.
Save csharpforevermore/7153352 to your computer and use it in GitHub Desktop.
Get the URL for a specific Umbraco API Controller (in this example, the Products API controller)
@{
Layout = null;
}
@{
string url = string.Format("{0}://{1}{2}?nodeId={3}", Request.Url.Scheme, Request.Url.Authority, Url.GetUmbracoApiService<ProductsApiController>("GetProductById"), Model.Content.Id);
}
<a href="@url" target="_blank">@url</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment