If I change Random(1) to Random(), I get the following error
Cannot implicitly convert type 'umbraco.MacroEngines.DynamicNode' to 'System.Collections.IEnumerable'. An explicit conversion exists (are you missing a cast?)
Nope, that works fine for me. I am using a recent nightly of the razor engine though, get umbraco.RazorEngines.dll from a recent nightly and put it in your /bin folder, might help.
'umbraco.MacroEngines.DynamicNodeList' does not contain a definition for 'Random'
Any ideas why the following script is producing the error
'umbraco.MacroEngines.DynamicNodeList' does not contain a definition for 'Random'
Source is a contentPicker property, and Limit is a numeric property
Thanks in advance for any assistance
source.Limit is probably interpreted as a string, so you need to cast it to an int first.
Thanks Sebastiaan
If I change source.Limit to an actual number, i.e. 1, so that the script becomes
The same error still occurs. Any ideas?
If I change Random(1) to Random(), I get the following error
Cannot implicitly convert type 'umbraco.MacroEngines.DynamicNode' to 'System.Collections.IEnumerable'. An explicit conversion exists (are you missing a cast?)
Nope, that works fine for me. I am using a recent nightly of the razor engine though, get umbraco.RazorEngines.dll from a recent nightly and put it in your /bin folder, might help.
Thanks for your help Sebastiaan. I have grabbed the latest bin and that has solved the problem - brilliant!
Beautiful! Would you mind please marking a post as the solution? Thanks!
is working on a reply...