It's been a long time since I tried that approach. The wiki page should still have the correct instructions.
The key part to keep in mind is that these data-types aren't typical .NET controls, many of them have prevalue config/settings, which need to be populated ... and some require a context of a content nodeId.
We do have an undocumented control called "EditProperty" - but is largely untested - as in I developed it for a client project, it worked for them, so I bundled it with uComponents for future use (and didn't develop it further).
This would then attempted to get the content node (for the specified NodeId) and property field (with the alias myUrlPickerAlias) and render the edit control for that.
Then in the code-behind there is a method myEditProperty.Save() that would attempt to update the node's property value.
Adding uComponents DataType to usercontrol
Hi.
How do I add uComponents DataType (e.g. UrlPicker) to my .ascx usercontrol?
This approach looks weird: http://our.umbraco.org/wiki/reference/code-snippets/use-mntp-on-a-usercontrol
Can't I just use something like: <umb:UrlPicker id=picker" runat="server" />
Hi Ivan,
It's been a long time since I tried that approach. The wiki page should still have the correct instructions.
The key part to keep in mind is that these data-types aren't typical .NET controls, many of them have prevalue config/settings, which need to be populated ... and some require a context of a content nodeId.
We do have an undocumented control called "EditProperty" - but is largely untested - as in I developed it for a client project, it worked for them, so I bundled it with uComponents for future use (and didn't develop it further).
This would then attempted to get the content node (for the specified
NodeId
) and property field (with the aliasmyUrlPickerAlias
) and render the edit control for that.Then in the code-behind there is a method
myEditProperty.Save()
that would attempt to update the node's property value.Feel free to give it a go... I can't say that it's going to work, but it's worth a try. The source-code for it is here: https://github.com/uComponents/uComponents/blob/master/src/uComponents.Controls/EditProperty.cs
Cheers,
- Lee
Hi Lee.
Thanks for sharing this new control. I'll give it a try.
is working on a reply...