I've been bashing my head against this now for about a day - all I want to do is have a media picker on a custom section. The page loads fine without the Picker on it, so I know it's something to do with the control. I've followed
class MediaPickerDataExtractor : IData { private object _value; public MediaPickerDataExtractor() { } public MediaPickerDataExtractor(object o) { Value = o; } #region IData Members public void Delete() { throw new NotImplementedException(); } public void MakeNew(int PropertyId) { throw new NotImplementedException(); } public int PropertyId { set { throw new NotImplementedException(); } } public System.Xml.XmlNode ToXMl(System.Xml.XmlDocument d) { throw new NotImplementedException(); } public object Value { get { return _value; } set { _value = value; } } #endregion }
_mediaPickerExtractor = new MediaPickerDataExtractor(); _mediaPicker = new umbraco.editorControls.mediaChooser(_mediaPickerExtractor, true, true); _mediaPicker.Value = ""; //_mediaPicker.ID = "mediapicker"; pickerPlaceHolder.Controls.Add(_mediaPicker); base.OnInit(e);
Custom section is registered fine, but when I click on the page, I get the following:
[NullReferenceException: Object reference not set to an instance of an object.]
umbraco.editorControls.mediaChooser.CreateChildControls() +136
System.Web.UI.Control.EnsureChildControls() +102
MPUManagementPage.OnInit(EventArgs e) +197
System.Web.UI.Control.InitRecursive(Control namingContainer) +140
problem with media picker in custom section
Hi all,
I've been bashing my head against this now for about a day - all I want to do is have a media picker on a custom section. The page loads fine without the Picker on it, so I know it's something to do with the control. I've followed
on my ASPX page I have:
then in code-behind file I have:
Then I have at the top of my page class:
Before finally in the OnInit function:
Custom section is registered fine, but when I click on the page, I get the following:
Does anyone have any ideas?
Many thanks
Simon
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.