Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How can I access the value of a Dictionary Item from within a Razor script (.cshtml)?
Thanks for your help,
It actually seems it's covered a little bit in the Razor Cheat Sheet in the lower left section named "Dictionary".
Hope this helps :)
... having to get Razor help from the Xslt Rebel Alliance, this is a total embarrasment :)
Thanks for the tip.
Sebastian (@Cultiv) also gave me some help. Dictionary Items can be accessed in Razor script using the umbraco.library.GetDictionaryItem("DictionaryItem")
This works great me.
Jeavon Leopold (@crumpled_jeavon) pointed me to and example using the Dictionary Picker in Razor
I checked the Razor DynamicNode Cheatsheet, this code does the job:
I'm just happy I was able to help you out so you can make awesomeness in Umbraco :)
Have fun mate.
FYI the Umbraco Documentation has now documentation on using Dictionary Items in Razor
The cheat sheet still needs some updates. Yes, you can find it in the documentation...
Since this IS documentation...
As of 7.x, you can use
I just used this today:
var download = Umbraco.Field(#Download").ToString(); // call ToString() otherwise it is IHtmlString
//** Almost 3 years later...
I am working on a partial view that only inherits a custom view model and couldn't use Umbraco.Field. So in that scenario, this is what to use:
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted