var data = JsonConvert.DeserializeObject(value.ToString());
public class LinkPickerModel
{
public int Id { get; set; }
public string Name { get; set; }
public string Url { get; set; }
public string Target { get; set; }
public string Hashtarget { get; set; }
}
Macro parameter Json to model
Hello,
I've got this piece of code
The ouput of that is
How can I get json to a model? Is there something in umbraco or need to write some custom code to deserialize it?
So i've got this code and works correctly but is there a better way of doing it?
Hi
Try to use this code:
Hope it will help you.
Thanks,
Alex
Are you using "Multi Url Picker" or "Link Picker"?
It's Multi Url Picker.
You can simplify these lines:
To:
Thanks,
Alex
Yeah, I know. But I'm wondering if there is a better way of casting macro parameter to Multi Url Picker model.
is working on a reply...