[CLOSED] coolite htmleditor Error

  1. #1

    [CLOSED] coolite htmleditor Error

    hi,

    i am using html editor and bind html data in page load. after that i click the ajax event button i got a error

    A potentially dangerous request.Form value was detected from the client(Htmleditor1="<p>@nbsp;</p>").


    . please help me.
  2. #2

    RE: [CLOSED] coolite htmleditor Error

    *Hi,

    You can set ValidateRequest=false for Page directive *(may be it is not good solution, it is depend from execution page context)

    <%@ Page Language="C#" ValidateRequest="false" %>
    We will try to encode editor content
    Last edited by geoffrey.mcgill; Feb 20, 2011 at 1:16 PM.
  3. #3

    RE: [CLOSED] coolite htmleditor Error

    The HtmlEditor now encode the HTML during form submission. You should no longer need to set the Pages ValidateRequest property.

    Hope this helps.


    Geoffrey McGill
    Founder
  4. #4

    RE: [CLOSED] coolite htmleditor Error

    Here's a full sample demonstrating using an AjaxEvent to save the contents of the HtmlEditor.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>
    
    <script runat="server">
        protected void Button1_Click(object sender, AjaxEventArgs e)
        {
            this.Label1.Html = this.HtmlEditor1.Text;
        }
    </script>
    
    
    <!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 runat="server">
        <title>HtmlEditor with no ValidateRequest</title>
    </head>
    <body>
        <form id="form1" runat="server">
            
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
            <ext:HtmlEditor ID="HtmlEditor1" runat="server" />            
    
            <ext:Button
                ID="Button1" 
                runat="server" 
                Text="Save" 
                Icon="Disk">
                <AjaxEvents>
                    <Click OnEvent="Button1_Click" />
                </AjaxEvents>    
            </ext:Button>
            
            <ext:Label ID="Label1" runat="server" />            
                
        </form>
    </body>
    </html>
    Geoffrey McGill
    Founder
  5. #5

    RE: [CLOSED] coolite htmleditor Error

    Is this fix available in the public release 0.7.0 or will I have to SVN update to get this?
  6. #6

    RE: [CLOSED] coolite htmleditor Error

    Hi,

    I think you should update.
    Only please note one limitation*(if*ValidateRequest=false then this limitation is absent)*: the html editor can successful submit your value only if Source code mode is not active before request (it is mean that current mode must be Standart, not Source). You can switch between Source and Standart mode while working with page but before request need to set Standart.






  7. #7

    RE: [CLOSED] coolite htmleditor Error

    can we switch from source view to standard view using a javascript code? which can be executed before the page submits?

    i have this form with 2 html editors in it, then i added this code to the button which submits the data, but the html editors are not switching to standard mode before the page submits


    
    <Click Before="#{exttxtDefinition}.toggleSourceEdit(false); #{exttxtReference}.toggleSourceEdit(false); "   
                        OnEvent="extDictionaryTermControlOK_Click"  />

Similar Threads

  1. [CLOSED] [1.0] HtmlEditor js error on destroy
    By jchau in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 20, 2010, 9:09 PM
  2. error in HtmlEditor
    By maxdiable in forum 1.x Help
    Replies: 4
    Last Post: Jan 20, 2010, 1:23 PM
  3. [CLOSED] [1.0] HtmlEditor Error
    By Ben in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 02, 2009, 7:46 AM
  4. Help...HtmlEditor Error
    By SamBoKing in forum 1.x Help
    Replies: 3
    Last Post: Sep 14, 2009, 5:41 AM
  5. [CLOSED] htmlEncode and HtmlEditor (Coolite 0.7)
    By macap in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 03, 2009, 5:52 AM

Posting Permissions