locked
editor bottom toolbar RRS feed

  • Question

  • User693597704 posted

    I have been searching for a way to hide the bottom toolbar for the editor. I keep seeing to add this to the css file...

    .ajax__htmleditor_editor_bottomtoolbar {
        display:none;
    }

    I have added it, but can not figure out how to use it from the codebehind page to toggle the bottom toolbar on/off. I am using VB as language. Could someone help with an example please?

    Wednesday, March 18, 2015 8:18 PM

Answers

  • User693597704 posted

    I got it working now for my application what I did was

    add a label to the website and I have a button that allows select users to edit and save.    So then....

    1 in normal mode set label.text = editor.content and hide the editor

    2) in edit mode for select users hide the label and show the editor

    grrrr so many days for such a simple fix

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 21, 2015 9:19 AM

All replies

  • User177399542 posted

    Hi to remove bottom toolbar of HTMLEditorExtender set DisplaySourceTab="false"

     <ajaxToolkit:HtmlEditorExtender EnableSanitization="false" ID="htmlEditorExtender1" TargetControlID="txtBox1" runat="server" DisplaySourceTab="false">

    Thursday, March 19, 2015 8:06 AM
  • User693597704 posted

    Thanks, That works fine when I open locally. But When I uploaded the page to my website it is not working, the page is still showing the bottom toolbar

    here is what I have

    <cc1:Editor ID="Editor1" runat="server" SuppressTabInDesignMode="True" DisplaySourceTab="false" Height="733px"/>

    Thursday, March 19, 2015 9:32 AM
  • User693597704 posted

    I can not figure out what it is going on here The bottom toolbar is hidden when I run the file from visual web developer but it is there when I upload it to the website

    Thursday, March 19, 2015 9:36 PM
  • User1711366110 posted

    steve03602

    I can not figure out what it is going on here The bottom toolbar is hidden when I run the file from visual web developer but it is there when I upload it to the website


      As per your case, I suggest you to toggle the editor control by using javascript as below:

    <%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="false"
        CodeFile="Default.aspx.vb" Inherits="_Default" %>
    
    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit.HTMLEditor" tagprefix="cc1" %>
    <head>
    <script type="text/javascript">
    function toggle() 
     {
      var controlId = document.getElementById('<%= Editor1.ClientID %>');
      controlId.style.display = (controlId.style.display != 'none') ? 'none' : 'inline';
    }
    </script> </head> <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"> </asp:Content> <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <h2> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </h2> <cc1:Editor ID="Editor1" runat="server" SuppressTabInDesignMode="True" DisplaySourceTab="false" Height="800px" /> <p> <asp:Button ID="EditPage" runat="server" Text="Edit Page" Visible="False" /> <asp:Button ID="SaveEdit" runat="server" Text="Save Edit" OnClientClick="toggle();" Visible="False" /> </p> </asp:Content>

    Otherwise you can toggle the editor control by using jQuery also. Click here to refer.

    --
    with regards,
    Edwin

    Thursday, March 19, 2015 10:57 PM
  • User693597704 posted

    hi Edwin,

    The toggle method gives me the following error

    Error 4 Only Content controls are allowed directly in a content page that contains Content controls.  

    Thursday, March 19, 2015 11:13 PM
  • User1711366110 posted

    Hi Steve,
     You can place your JavaScript inside inside the Content page like below :

    <%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="false"
        CodeFile="Default.aspx.vb" Inherits="_Default" %>
    
    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit.HTMLEditor" tagprefix="cc1" %>
    
    <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    </asp:Content>
    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
     <script type="text/javascript">
      function toggle() 
      {
        var controlId = document.getElementById('<%= Editor1.ClientID %>');
        controlId.style.display = (controlId.style.display != 'none') ? 'none' : 'inline';
      }
      </script>
        <h2>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
         
            </asp:ScriptManager>
        </h2>
        <cc1:Editor ID="Editor1" runat="server" SuppressTabInDesignMode="True" DisplaySourceTab="false" Height="800px" />
    
        <p>
            <asp:Button ID="EditPage" runat="server" Text="Edit Page" Visible="False" />
            <asp:Button ID="SaveEdit" runat="server" Text="Save Edit" OnClientClick="toggle();" Visible="False" />
        </p>
        </asp:Content>

    Click here to know more about placing the javascript in content page.

    --
    with regards,
    Edwin

    Thursday, March 19, 2015 11:34 PM
  • User693597704 posted

    Hi Edwin, I was just replying when I saw this one.....

    got it to work without the error .... needed to move the function under content area unfortunately that is not doing the trick either it is functioning exactly the same as what Anuj had suggested

    here is link for the view when seen from local from Visual Web Developer http://gcbr.net/bottomhidden.jpg (what I want to do)

    and if you go to my website I am working on http://gcbr.net you will see the bottom toolbar is still visible (not what I want to do)

    Thursday, March 19, 2015 11:42 PM
  • User693597704 posted

    Can someone please help with this? From my searching it looks like it happens a lot, but none of the fixes seem to work for me. The issue happens in all browsers, yet it works fine on my test computer with what Anuj suggested above

    Saturday, March 21, 2015 8:41 AM
  • User693597704 posted

    I got it working now for my application what I did was

    add a label to the website and I have a button that allows select users to edit and save.    So then....

    1 in normal mode set label.text = editor.content and hide the editor

    2) in edit mode for select users hide the label and show the editor

    grrrr so many days for such a simple fix

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 21, 2015 9:19 AM