Skip to content

Instantly share code, notes, and snippets.

@spboyer
Created August 17, 2018 14:28
Show Gist options
  • Save spboyer/bef0c1d0639871ae425de5a427e6fa00 to your computer and use it in GitHub Desktop.
Save spboyer/bef0c1d0639871ae425de5a427e6fa00 to your computer and use it in GitHub Desktop.
azure cdn image tag helper
if (AppendVersion)
{
EnsureFileVersionProvider();
Src = output.Attributes[SrcAttributeName].Value as string;
// Check if the CDN Base URI is set and add to the src attribute
if (!string.IsNullOrWhiteSpace(CdnUri))
{
output.Attributes.SetAttribute(SrcAttributeName, string.Format("{0}{1}", CdnUri, _fileVersionProvider.AddFileVersionToPath(Src)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment