Last post Jan 22, 2014 08:17 PM by Happy Chen - MSFT
Jan 20, 2014 08:56 AM|gani7787|LINK
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...?
Jan 20, 2014 10:41 PM|chetan.sarode|LINK
Set ActiveMode="preview" in the example "HTMLEditor without bottom toolbar".
Please refer to:http://forums.asp.net/p/1472729/3415051.aspx
Jan 20, 2014 10:45 PM|Happy Chen - MSFT|LINK
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
Hope it helps you.
Jan 21, 2014 04:03 AM|gani7787|LINK
can you give more examples...?
i need just want to disable or read only controls...
Jan 22, 2014 04:02 AM|Happy Chen - MSFT|LINK
When you try to set to Enabled="false" , then only Font and Size dropdowns disabled, Remaining all are
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:
<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>
<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;
Jan 22, 2014 04:22 AM|gani7787|LINK
thanks for your reply..
how to hide bottom tool bar (preview,html and design mode) image.
Jan 22, 2014 08:17 PM|Happy Chen - MSFT|LINK
please add the css style below to the head of page :
It is working for me.