Re: EnableStripScriptTags not working version 6.6

  •  05-31-2010, 7:25 AM

    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 Complete Thread