Posts

Showing posts from August, 2013

c# Umbraco Razor Display List of all Session Varioables

@inherits umbraco.MacroEngines.DynamicNodeContext
<p>Session Variables</p>

@HttpContext.Current.Items.Count:<br />


@for (int i =1; i <= @HttpContext.Current.Session.Contents.Count; i++)
{
   @HttpContext.Current.Session.Keys[i-1];
<br />

}

Umbraco Razor Media Picker - how to display a link from the media picker

var node = Library.NodeById(Model.videoFollowUpLink);
    <a href="@node.Url">@node.Name</a>

Umbraco Razor Last Updated Date and Time

@inherits umbraco.MacroEngines.DynamicNodeContext


<p><small>This page was last updated on: @Model.UpdateDate.ToString("dd.MM.yyyy") at @Model.UpdateDate.ToString("HH.mm") </small></p>



Example Output:

This page was last updated on: 01.08.2013 at 13.18