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
Hello,
In a razor macro you can do Dictionary.Blah. What i want to do is use the dynamic dictionary object in a usercontrol so i dont have to keep doing umbraco.library.GetDictionaryItem("blah"). Is it possible to do this if it is then how.
Many thanks
Ismail
Hi. I think you can use a raw CultureDictionary object (in the umbraco.MacroEngines namespace) like this:
private CultureDictionary cultureDictionary;protected dynamic Dictionary{ get { cultureDictionary = cultureDictionary ?? new CultureDictionary(); return cultureDuctionary; }}
Rodion,
Many thanks just a slight tweak to the code :
private UmbracoCultureDictionary cultureDictionary;
protected dynamic Dictionary
{
get
cultureDictionary = cultureDictionary ?? new UmbracoCultureDictionary();
return cultureDictionary;
}
Regards
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Razor dictionary in usercontrol
Hello,
In a razor macro you can do Dictionary.Blah. What i want to do is use the dynamic dictionary object in a usercontrol so i dont have to keep doing umbraco.library.GetDictionaryItem("blah"). Is it possible to do this if it is then how.
Many thanks
Ismail
Hi. I think you can use a raw CultureDictionary object (in the umbraco.MacroEngines namespace) like this:
Rodion,
Many thanks just a slight tweak to the code :
private UmbracoCultureDictionary cultureDictionary;
protected dynamic Dictionary
{
get
{
cultureDictionary = cultureDictionary ?? new UmbracoCultureDictionary();
return cultureDictionary;
}
}
Regards
Ismail
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.