Trying to grab the niceurl for an image.. But says cannot implicitly convert string to int .. any help would be good ... Thanks I think Im having data type issues, thought it was an int32
Its because umbraco.library.NiceUrl(Convert.ToInt32(prop.Value)); will be returning the url as a string but you have told EventImageURLID that it is an int
If you just want the id of the document then you should cut the umbraco.library.NiceUrl out and just have int EventImageURLID = Convert.ToInt32(node.GetProperty("image").Value);
umbraco.library.niceurl
// image processing.. prop = node.GetProperty("image"); int EventImageURLID = umbraco.library.NiceUrl(Convert.ToInt32(prop.Value)); evt.EventImage = (Convert.ToInt32(EventImageURLID));
Trying to grab the niceurl for an image.. But says cannot implicitly convert string to int .. any help would be good ... Thanks I think Im having data type issues, thought it was an int32
Its because umbraco.library.NiceUrl(Convert.ToInt32(prop.Value)); will be returning the url as a string but you have told EventImageURLID that it is an int
If you just want the id of the document then you should cut the umbraco.library.NiceUrl out and just have int EventImageURLID = Convert.ToInt32(node.GetProperty("image").Value);
Trying to create a property for the node, is there a better way to get that data? ie. So I can set it as the ImageURL in an asp.net control ?
If you are trying to get the URL programatically I think you can use the code you had in the first post, just change the int to a string;
string EventImageURL = umbraco.library.NiceUrl(number of node id);
I am not sure a node can have properties, but to change a property of a Document you can use;
Document.getProperty("property").Value = "string";
(This is assuming the property on the document already exists, if you are needing one added programatically I think you can use Document.addProperty)
is working on a reply...