hello Cees,
You must use the EmbeddedImagePicker property itself in code. What you see in declarative code is the same property serialized to an xml representation and ineffect it looks more like we are manually embedding an image picker.
To translate what you are trying to achieve in code, this is how you would go about it :
| C# |
|
protected void Page_Init(object sender, EventArgs e) { Editor1.EmbeddedImagePicker.ImageBrowserEnabled = true; Editor1.EmbeddedImagePicker.ImageUploaded += new UploadedImageFileEventHandler(EmbeddedImagePicker_ImageUploaded); Editor1.EmbeddedImagePicker.BrowseServerRequest += new EventHandler(EmbeddedImagePicker_BrowseServerRequest); }
void EmbeddedImagePicker_BrowseServerRequest(object sender, EventArgs e) { //populate the nodes }
void EmbeddedImagePicker_ImageUploaded(object sender, UploadedImageFileEventArgs e) { //do something with uploaded image }
|
Somethings to note is how I don't create a new instance of an imagepicker but rather use the instance exposed by the editor itself. Let me know if something is not clear.
Have a good day,