Skip to content

Instantly share code, notes, and snippets.

@mortenbock
Created September 28, 2012 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mortenbock/3799194 to your computer and use it in GitHub Desktop.
Save mortenbock/3799194 to your computer and use it in GitHub Desktop.
Simple helper renderer
using umbraco.NodeFactory;
namespace Sample.Web.UI
{
public class UmbImage : System.Web.UI.HtmlControls.HtmlImage
{
public string Field
{
set
{
string mediaUrl = Node.GetCurrent().GetOptionalMediaUrl(value); //Extension method. Could be more defensive
base.Src = mediaUrl;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment