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...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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...