Hi Bloodcarver,
I suggest you try the example below. It will keep the doctype setting and remove the html/head/body target. Then you can keep use the doctype and not allow the user edit the complete document.
- <%@ 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>example</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <CE:Editor ID="editor1" runat="server" EditCompleteDocument="true" DOCTYPE='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.gg.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>
- </CE:Editor>
- </form>
- </body>
- </html>
-
- <script>
- function CuteEditor_FilterHTML(editor,code)
- {
- code=code.replace(/(<html[^\>]*\>)([\s\S]*)(\<\/html\>)/ig, "$2");
- code=code.replace(/(<head[^\>]*\>)([\s\S]*)(\<\/head\>)/ig, "$2");
- code=code.replace(/(<body[^\>]*\>)([\s\S]*)(\<\/body\>)/ig, "$2");
- return code;
- }
- function CuteEditor_FilterCode(editor,code)
- {
- code=code.replace(/(<html[^\>]*\>)([\s\S]*)(\<\/html\>)/ig, "$2");
- code=code.replace(/(<head[^\>]*\>)([\s\S]*)(\<\/head\>)/ig, "$2");
- code=code.replace(/(<body[^\>]*\>)([\s\S]*)(\<\/body\>)/ig, "$2");
- return code;
- }
- </script>
Regards,
Ken