locked
How to Disable AJAX HTML Editor control while page loading.. RRS feed

  • Question

  • User-1024101449 posted

    I have used AJAX HTML Editor control.

    When i click the submit button, i want to Disable (Read Only) the AJAX HTML Editor entire control.

    I tried many code's and i waiting for this answer very long back. but. it will not work.

    pls. suggest me how to disable AJAX HTML Editor Control.

    can you pls. help us...?

    Monday, January 20, 2014 8:56 AM

Answers

  • User-933407369 posted

     

    When you try to set to Enabled="false" , then  only Font and Size  dropdowns disabled, Remaining all are enabled.

     As chetan said, you can set ActiveMode="preview", ActiveMode has three mode- Active editing panel (Design, Html, Preview) on control loaded.

    Please check out the demo:

    .ASPX PAGE:

      <div>
              <ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" EnablePartialRendering="true" EnableScriptGlobalization="true" EnableScriptLocalization="true" runat="Server" />
           <cc1:Editor ID="editor1" runat="server" Enabled="false" Width="400" Height="600" />  
    
    <asp:TextBox  ID="txtbox1" runat="server" Enabled="false" ></asp:TextBox> 
        </div>
            <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

    CodeBehind( using AjaxControlToolkit.HTMLEditor;):

     protected void Button1_Click(object sender, EventArgs e)
            {
                    //you can use the code to change the mode
    editor1.ActiveMode = ActiveModeType.Preview; }

    Hope it helps you.

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 22, 2014 4:02 AM
  • User-933407369 posted

    please add the css style below to the head of page :

    .ajax__htmleditor_editor_bottomtoolbar {
        display:none;
    }

    It is working for me.


     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 22, 2014 8:17 PM

All replies

  • User555306248 posted

    Set ActiveMode="preview" in the example  "HTMLEditor without bottom toolbar".

    Please refer to:http://forums.asp.net/p/1472729/3415051.aspx

    Monday, January 20, 2014 10:41 PM
  • User-933407369 posted

    hi,

    HTML ditor content in html editor is just IFrame, you can't disable it like you can't disable the IFrame directly.

    But there is a workround. You can define onkeypress or onkeydown event for this IFrame to catch something, then you can clear that or return false..

    please refer to the link below for details:

    Enable and Disable Ajax control kit html editor

    http://forums.asp.net/t/1472729.aspx

    Hope it helps you.

     

     

    Monday, January 20, 2014 10:45 PM
  • User-1024101449 posted

    can you give more examples...?

    i need just want to disable or read only controls...

    pls. help..

    Tuesday, January 21, 2014 4:03 AM
  • User-933407369 posted

     

    When you try to set to Enabled="false" , then  only Font and Size  dropdowns disabled, Remaining all are enabled.

     As chetan said, you can set ActiveMode="preview", ActiveMode has three mode- Active editing panel (Design, Html, Preview) on control loaded.

    Please check out the demo:

    .ASPX PAGE:

      <div>
              <ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" EnablePartialRendering="true" EnableScriptGlobalization="true" EnableScriptLocalization="true" runat="Server" />
           <cc1:Editor ID="editor1" runat="server" Enabled="false" Width="400" Height="600" />  
    
    <asp:TextBox  ID="txtbox1" runat="server" Enabled="false" ></asp:TextBox> 
        </div>
            <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

    CodeBehind( using AjaxControlToolkit.HTMLEditor;):

     protected void Button1_Click(object sender, EventArgs e)
            {
                    //you can use the code to change the mode
    editor1.ActiveMode = ActiveModeType.Preview; }

    Hope it helps you.

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 22, 2014 4:02 AM
  • User-1024101449 posted

    thanks for your reply..

    how to hide bottom tool bar (preview,html and design mode) image.

    Wednesday, January 22, 2014 4:22 AM
  • User-933407369 posted

    please add the css style below to the head of page :

    .ajax__htmleditor_editor_bottomtoolbar {
        display:none;
    }

    It is working for me.


     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 22, 2014 8:17 PM