Initial Edit Mode

4 posts, 0 answers
  1. jason777
    jason777 avatar
    16 posts
    Member since:
    Jul 2006

    Posted 14 Aug 2008 Link to this post

    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?
  2. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 14 Aug 2008 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. jason777
    jason777 avatar
    16 posts
    Member since:
    Jul 2006

    Posted 14 Aug 2008 Link to this post

    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.
  5. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 15 Aug 2008 Link to this post

    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.
Back to Top