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

Issue reading external html file when radeditor loads

3 Answers 93 Views
Editor
This is a migrated thread and some comments may be shown as answers.
mulligann
Top achievements
Rank 1
mulligann asked on 04 Feb 2009, 07:46 PM
I am trying the Q3 version of the rad controls, working with radeditor trying to save the content to an external .html file.  When the page loads I put text into the editor and it correctly saves the .html file.  I go back to another page and then reload the editor page and the .html file will not load into the editor.  I am using the Q3 version of the rad controls, VS 2005, VB, and ASP.NET 2.0.  I have used the code from the demo pages excluding the Namespace line because I get an error in the Page_Load sub that radeditor.content is not a shared member.  Not sure how to fix this, or if I can use this if I'm not using .NET 3.5 and VS 2008.

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 09 Feb 2009, 01:38 PM
Hi Mulligann,

I was not able to reproduce the problem and for your convenience I have attached my test .NET 2.0 project and video demonstrating my test. Please, test the project and if you still experience the problem provide step-by-step instructions how to recreate it on my side.

Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
mulligann
Top achievements
Rank 1
answered on 11 Feb 2009, 06:45 PM
Thanks for the reply.  I subscribed to this thread and was hoping to get an email when someone had replied to my question, but didn't.  I logged in today to see if anyone had an answer for me and to tell you that I found the answer. 

In your code on the demo pages you have:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
            If Not Page.IsPostBack Then
                RadEditor1.Content = ReadFile(Server.MapPath(path))
            End If
        End Sub


I couldn't get the page to load the .html file.  I added  "Handles Me.Load"  after "EventArgs)" and that seemed to fix the issue.  I will download your tests and have a look at them as well.  I also found that you can use save to an .ascx file as well.  Which makes it easier on the front end to register the ascx file instead of using an iframe to show the updated html file on the website.
0
Tervel
Telerik team
answered on 13 Feb 2009, 08:50 AM
Hi mulligann,

To get ASP.NET to automatically "hook up" page event handlers, you need to have
<%@ Page AutoEventWireup="true"> in your page directive (which is in fact the default when new pages in Visual Stuid are created).

If you have removed this attribute, or you set it to false, then you will need to explicitly add the Handles Me.Load part
Best regards,
Tervel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
mulligann
Top achievements
Rank 1
Answers by
Rumen
Telerik team
mulligann
Top achievements
Rank 1
Tervel
Telerik team
Share this question
or