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

[Solved] DBFileBrowserContentProvider in MVC

7 Answers 139 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
King Wilder
Top achievements
Rank 2
King Wilder asked on 15 Feb 2010, 11:24 PM
I'm trying out your example using the DBFileBrowserContentProvider in an ASP.NET MVC v2 RC2 app and I was able to upload an image to the database, I'm having a little difficulty retrieving the image to place in my content.

When I click the ImageManager button in the RadEditor to select the image and insert it into my HTML, the filename is there for the image, but the image never appears in the right-hand pane when I click the filename.  Is the image rendered by the Handler.ashx file in the RadEditor?

Here's a short screencast I made of my problem.  http://www.screencast.com/t/OTZhZWIwZ

Also, I wasn't able to save my image to the database until I manually went into the database and created records for ROOT, Images, etc.  Is this by design or should I be able to insert into the database without initializing it this way?

Thanks,

King Wilder

7 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 18 Feb 2010, 03:25 PM
Hello King,

In reference to your questions:
  • In your case I suppose that the path to the pasted image is not correct. Could you please switch to HTML view, after you have pasted an image from the ImageManager, and check the image's path. For example the image's tag should looks like this:
    <img alt="" src="/Handler.ashx?path=ROOT%252fImages%252fNature%252fFruits%252fImage1.jpg" />
    We are aware of a problem with the path to the handler that is pasted inside the editor's area in a MVC environment. The wrong path looks like this:
    <img alt="" src="//Handler.ashx?path=ROOT%252fImages%252fNature%252fFruits%252fImage1.jpg" />

    The solution is to remove the starting ~ sign from the beginning  of the handler's declaration in the web.config file.

    The code that is causing the problem:
    <appSettings>
        <add key="Telerik.WebControls.EditorExamples.ItemHandler"
             value="~/PathToHandler/Handler.ashx" />
    </appSettings>

    The working code:
    <appSettings>
        <add key="Telerik.WebControls.EditorExamples.ItemHandler"
             value="/PathToHandler/Handler.ashx" />
    </appSettings>
  • In order to use the provided DBContentProvider you should manually create least one folder, which will be set to the ViewPaths, UploadPaths, DeletePaths properties of the Editor's managers. Then you can create child folders inside that ROOT folder by using the Manager's interface.

I hope this helps.

Kind regards,
Fiko
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
King Wilder
Top achievements
Rank 2
answered on 18 Feb 2010, 07:00 PM
Fiko,

You were exactly right.  That was it!

I made another short screencast to show that this modification worked.  http://www.screencast.com/t/MjEyOWJiM2Yt

I hope the videos help.  If you want me to stop posting them, I will.

Thanks,

King Wilder



0
Dwayne
Top achievements
Rank 1
answered on 26 Aug 2010, 06:43 PM
I have fixed the issue as described but i still cant display the uploaded Image.

MY ENDING IMG SRC LOOKS LIKE THIS :/UserControls/Page/Handler.ashx?path=ROOT%2fImages%2fAbout+us%2fIMAGE.gif
but it still does not display .

I took the code  for the contentprovider and for the dataserver  from the link below but i am still having an issue displaying the image in the image manager an on the editor canvas

http://www.telerik.com/community/code-library/aspnet-ajax/file-explorer/connect-radfileexplorer-or-radeditor-to-a-sql-databse.aspx


Thanks for anyhelp in advance.
0
Fiko
Telerik team
answered on 30 Aug 2010, 04:32 PM
Hi Dwayne,

I need to examine your exact code in order to provide a woking solution for you. This is why, could you please isolate the problem in a small working project (such as the one provided in the code library), open a new support ticket and send it to me? I will debug it on my side and do my best to provide a solution as soon as possible.

Sincerely yours,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Dwayne
Top achievements
Rank 1
answered on 02 Sep 2010, 02:41 PM
I tried adding a thread to the public issue tracker and it responded that my subscription was not to date so I was unable to continue. Duew to the current economic climate it is not a priority to invest in a renewl subscription is there some other way to submit the code or have i gone about it all wrong.
0
Fiko
Telerik team
answered on 07 Sep 2010, 02:20 PM
Hello Dwayne,

You can attach files to a thread of type "General Feedback", so could you please open a new "General Feedback" ticket and send the code? Please, just make sure that I can run the code on my side.

Kind regards,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Dwayne
Top achievements
Rank 1
answered on 21 Sep 2010, 02:53 PM
All the code seemed to be the same but mine still didn't work so I start to do some  more thinking and I noticed the markup of the handlers were inheriting the wrong class.I guess the lesson learnt is that it's not good to rename ashx files unless you know that you change all the inheritance.. Now it inserts the image in my page but i am not getting a preview this could be bacuse i was running the code localhost a real server could render the image thanks alot

Tags
General Discussions
Asked by
King Wilder
Top achievements
Rank 2
Answers by
Fiko
Telerik team
King Wilder
Top achievements
Rank 2
Dwayne
Top achievements
Rank 1
Share this question
or