This is a migrated thread and some comments may be shown as answers.

RadEditor & Binary Image

4 Answers 204 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Martyn Fewtrell
Top achievements
Rank 1
Martyn Fewtrell asked on 26 Jan 2011, 02:56 PM
Hi there

I am quite familiar with loading images into SQL using file streams and blob data and can happily output them to a page using a handler or other means (assume your binary image control is straight forward).

Is there any way of inserting a binary image (or at least an image or document) from within a database using the RadEditor control. In essence I need an image manager that takes images from a database rather than from the file system.

I'm also sure I could probably do it by typing in the correct code but this needs to be possible for an end user.

Thanks for any comments

Martyn Fewtrell
http://www.networkclub.co.uk

4 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 28 Jan 2011, 01:01 PM
Hi Martyn,

Please, see the following live demo which could be helpful for your scenario: Custom File Dialogs Content Provider. The following forum thread could be useful as well: how to get content in to Rad Editor.

Kind regards,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Martyn Fewtrell
Top achievements
Rank 1
answered on 28 Jan 2011, 01:21 PM
Thanks Rumen

I havn't read through the sugested demo fully but im thinking something like:

1. Create my own "Image Library" on a modal pop up and perhaps a repeator to show the images drawn off the database and displayed with the binary image control. I could add a file upload option and some type of browsing facility.I assume the DBFileBrowserContentProvider does much of the data access for me?

Or are you sugesting I can connect the Image Manager to the database directly using the  DBFileBrowserContentProvider?

2. Depending upon the selected image somehow insert a line of code into the code window of RadEditor (which loads the image from SQL on the web page).

Would it be possible to insert a binary image control into the RadEditor page using code and would it work in the RadEditor preview window or should I create a handler as I have done this in the past?

I guess the problem area for me at the moment is how I insert a biary file image into the RadEditor interface?

PS I am new to your controls so apologise if I am missing the obvious!

Thanks

Martyn Fewtrell
0
Rumen
Telerik team
answered on 02 Feb 2011, 01:20 PM
Hi Martyn,

Did you examine the suggested Custom File Dialogs Content Provider live demo of RadEditor?

This example demonstrates the implementation of a custom FileBrowserContentProvider under the Image Manager and other file browser dialogs of RadEditor, using a SQL database as a file source.

Custom FileBrowserContentProvider implementation allows using virtually any type of file sources for the FileBrowser dialogs (Image Manager, DocumentManager, Media Manager, Flash Manager, Template Manager):

  • Database
  • Custom role-based CMS system
  • Web service
  • Applications which use URL Rewriters


If you have installed the RadControls demo, the DBContentProvider class is available in the App_Code\Editor\ folder of the demo project or in this code library.


If you insert an image in the content area through the Image manager in the demo, you'll see that the image src points to a handler.ashx handler file.

<img alt="" src="/aspnet-ajax/Editor/Examples/DBFileBrowserContentProvider/Handler.ashx?path=ROOT%252fImages%252fNature%252fFruits%252f320155_1886.jpg" />

This file is available in the Editor/Examples/DBFileBrowserContentProvider installation folder.

It is not possible to insert RadBinaryImage or another server controls in the content area of RadEditor, because it is a standard editable IFRAME element. The browser could work and render valid HTML/XHTML tags only.

Kind regards,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Martyn Fewtrell
Top achievements
Rank 1
answered on 02 Feb 2011, 01:35 PM
Thanks Ruman

The following line -

<img alt="" src="/aspnet-ajax/Editor/Examples/DBFileBrowserContentProvider/Handler.ashx?path=ROOT%252fImages%252fNature%252fFruits%252f320155_1886.jpg" />

answers my question completely.

I havnt had chance to dig much deeper so far but will do so when time permits. Thank you for answering this question as it reassuring to know that the task is possible before taking up to much time in research.

Regards

Martyn Fewtrell
Tags
Editor
Asked by
Martyn Fewtrell
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Martyn Fewtrell
Top achievements
Rank 1
Share this question
or