none
How to disable SharePointPublishing:HtmlEditor editmode when the page show RRS feed

  • Question

  •  I have a htmleditor in my layout page. When my page finish loading, the window will focus to that editor if i set its ControlMode  to edit. However, if i set this to display (as below), it will not focus to the htmleditor but it is not editable anymore.



    Could anyone tell me how to setup the htmleditor in order to show the field as display mode first, but change to edit mode when someone click on that.

    asp:
       

         <SharePointPublishing:HtmlEditor ID="htmlEditor" runat="server" CssClass="htmlEditor" AllowHtmlSourceEditing="true" excludeFromSpellCheck="true" PopupEditorMode="true" UseIntranetMode="true"></SharePointPublishing:HtmlEditor>


            

    C# Page_Init():                                      
       
         SPRibbon ribbon = SPRibbon.GetCurrent(this.Page);
                        if (ribbon != null)
                        {
                            ribbon.TrimById("Ribbon.EditingTools.CPEditTab.Layout");
                            ribbon.TrimById("Ribbon.EditingTools.CPEditTab.EditAndCheckout");
            
                        }
            
                    htmlEditor.Field = new RichHtmlField();
                    htmlEditor.Field.ControlMode = SPControlMode.Display;
                    htmlEditor.Field.EnableViewState = true;
                    htmlEditor.Field.AllowReusableContent = false;
                    htmlEditor.Field.MinimumEditHeight = "200px";
                    this.Controls.Add(htmlEditor.Field);


    Monday, February 13, 2017 5:22 AM

All replies