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.
- <%@ Page Language="C#" %>
-
- <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head id="Head1" runat="server">
- <title>Untitled Page</title>
- </head>
-
- <script runat="server">
- protected void showHtmlView_Click(object sender, EventArgs e)
- {
- Editor1.ShowHtmlMode = true;
- }
-
- protected void hideHtmlView_Click(object sender, EventArgs e)
- {
- Editor1.ShowHtmlMode = false;
- }
- </script>
-
- <body>
- <form id="form1" runat="server">
- <CE:Editor ID="Editor1" runat="server">
- </CE:Editor>
- <asp:Button ID="showHtmlView" runat="server" Text="show html tab" OnClick="showHtmlView_Click" />
- <asp:Button ID="hideHtmlView" runat="server" Text="hide html tab" OnClick="hideHtmlView_Click" />
- </form>
- </body>
- </html>
Regards,
ken