EnableStripScriptTags not working version 6.6

Last post 05-31-2010, 7:25 AM by Eric. 2 replies.
Sort Posts: Previous Next
  •  05-31-2010, 6:09 AM 61452

    EnableStripScriptTags not working version 6.6

    Using cuteeditor 6.6
     
    When inserting script to in the editor - all script is removed!
     
    I am using EnableStripScriptTags=false when using my editor. Have also tried

    FTBCMS.EnableStripScriptTags = False

     
    what's wrong?
  •  05-31-2010, 7:25 AM 61453 in reply to 61452

    Re: EnableStripScriptTags not working version 6.6

    Solved.
     
    Remember to put <!-- --> around script code!
     
    Ex

    <script type="text/javascript">

    <!--

    $(document).ready(function() {

    $(".accordion h3:first").addClass("active");

    $(".accordion p:not(:first)").hide();

    $(".accordion h3").click(function() {

    $(this).next("p").slideToggle("fast")

    .siblings("p:visible").slideUp("fast");

    $(this).toggleClass("active");

    $(this).siblings("h3").removeClass("active");

    });

    });

    -->

    </script>

  •  05-31-2010, 7:25 AM 61454 in reply to 61452

    Re: EnableStripScriptTags not working version 6.6

    You can try the following code:

    <%@ Page Language="C#"%>
    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>

    <html>
        <head>
      <title>ASP and ASP.NET WYSIWYG Editor - EnableStripScriptTags</title> 
     </head>
     <body>
            <form runat="server">   
          <h1>EnableStripScriptTags</h1>
          <p style="width:760px;">Specifies whether to remove inject script before write the string into the db.
    When this property is set to true (the default) Cute Editor strips all script
    elements and script contents from the html. </p>
          <br>
          <p>The property is set to false in this example. Try type the following code in the code view.</p>
          <br>
          <p>
          &lt;script&gt;alert("This is a Test!")&lt;/script&gt;
          </p>
          <br>
          <CE:Editor id="Editor1" EnableStripScriptTags="false" runat="server" ></CE:Editor><br />
          <br>
          <asp:Literal ID="Literal1" Runat="server" />        
      </form>
     </body>
    </html>

    <script runat="server">
     void Page_Load(object sender, System.EventArgs e)
      {
         if (!IsPostBack)
      {
                Editor1.Text = @"<div> You need to turn off this property if you want to modify/keep the javaScript code.</div>";
      }
      else
      {
       Literal1.Text = "<h2>The HTML you typed is...</h2><br>";
       Literal1.Text += Server.HtmlEncode(Editor1.Text);
         }
     
     }
    </script>

    Regards,
    Eric
     
View as RSS news feed in XML