Re: How to make some text in HTML tab not editable

  •  07-17-2010, 2:47 AM

    Re: How to make some text in HTML tab not editable

    qngenera2010:
    So How do I show/hide the "HTML" tab
    programmatically? We want to show/hide the "HTML" tab based on user's permission which is configurable.
     
    Thanks, Qian

     
    Hi qngenera2010,
     
    Please try the example below, it show you how to show and hide the html tab programmatically.
     
    1. <%@ Page Language="C#"  %>   
    2.   
    3. <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>   
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    5. <html xmlns="http://www.w3.org/1999/xhtml">   
    6. <head id="Head1" runat="server">   
    7.     <title>Untitled Page</title>   
    8. </head>   
    9.   
    10. <script runat="server">   
    11.     protected void showHtmlView_Click(object sender, EventArgs e)   
    12.     {   
    13.         Editor1.ShowHtmlMode = true;   
    14.     }   
    15.   
    16.     protected void hideHtmlView_Click(object sender, EventArgs e)   
    17.     {   
    18.         Editor1.ShowHtmlMode = false;   
    19.     }   
    20. </script>   
    21.   
    22. <body>   
    23.     <form id="form1" runat="server">   
    24.         <CE:Editor ID="Editor1" runat="server">   
    25.         </CE:Editor>   
    26.         <asp:Button ID="showHtmlView" runat="server" Text="show html tab" OnClick="showHtmlView_Click" />   
    27.         <asp:Button ID="hideHtmlView" runat="server" Text="hide html tab" OnClick="hideHtmlView_Click" />   
    28.     </form>   
    29. </body>   
    30. </html>  
    Regards,
     
    ken
View Complete Thread