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

Initial Edit Mode

3 Answers 62 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 2
Kevin asked on 14 Aug 2008, 02:30 PM
I cant seem to find a way to get the editor to start in HTML mode.  It always starts in design mode when you enable all 3 modes.  Is there a way to do this?

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 14 Aug 2008, 03:15 PM
Hi jason777,

The following code example will set the editor in Html mode on page load

<script type="text/javascript">
function OnClientLoad(editor, args)
{
   editor.set_mode(2);
}
</script>
<
telerik:radeditor runat="server" id="RadEditor1" OnClientLoad="OnClientLoad"></telerik:radeditor>


Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Kevin
Top achievements
Rank 2
answered on 14 Aug 2008, 05:03 PM
Hmmm, so I assume there is no server side method to allow this.  I guess I could write out that javascript from the server side but that not optimal.  Thats odd a feature that easy to implement isnt in the api.
0
Rumen
Telerik team
answered on 15 Aug 2008, 11:08 AM
Hello jason777,

Basically, if you set the following code in the PageLoad event

RadEditor1.EditModes = EditModes.Html;

The editor will be rendered in Html mode, but will not display its Design and Preview modes.

Another way is to output the provided javascript in my earlier reply from the codebehind using RegisterClientScriptBlock or RegisterStartupScript server methods.

Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Kevin
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Kevin
Top achievements
Rank 2
Share this question
or