SetHTML UrlEncoded not properly

Last post 06-05-2009, 8:47 AM by jclee4843. 3 replies.
Sort Posts: Previous Next
  •  04-30-2009, 3:32 PM 51724

    SetHTML UrlEncoded not properly

    Hi
     
    I am experiencing a problem with SetHTML:
    SetHTML automatically encodes the parameter I pass in. If I pass in a URL with multiple query string, it screws up the & (See following code example). Can this be resolved?

    var editor1 = document.getElementById('<%=editor1.ClientID %>');

    editor1.SetHTML("<a href='http://www.test.com/track.aspx?t=e&l=fdkslfj&y=889'>test</a>");
     
    If I go the HTML view in the cuteEditor. The output is :
    <a href="http://www.eyereturn.com/track.aspx?t=e&amp;l=fdkslfj&amp;y=889">test</a>
     
    Thanks,
    David
  •  05-04-2009, 9:37 AM 51784 in reply to 51724

    Re: SetHTML UrlEncoded not properly

    Hi jclee4843,
     
    Try properties UseSimpleAmpersand, like:
     
     <CE:Editor ID="Editor1" runat="server" UseSimpleAmpersand="true">
    </CE:Editor>
     
    UseSimpleAmpersand W3C recommend that all '&' in query strings be converted to &amp; This is the only way to get a piece of HTML validated. The reason is that & is the start of an HTML entity, such as &pound;

    So this:
                
            <a href="page.aspx?var1=one&amp;va­r2=two">link</a>
    is valid, whereas:
            <a href="page.aspx?var1=one&var2=t­wo">link</a>
    isn't.
    If you still want to use simple Ampersand in query strings, you can set this property to true. if you want to retrieve the CuteEditor HTML content in XHTML format, the 'UseSimpleAmpersand' property will be ignored.
     
    Regards,
     
    Ken
  •  06-05-2009, 8:33 AM 52822 in reply to 51724

    Re: SetHTML UrlEncoded not properly

    Thanks, I will try it out
     
    For some weird reason, if I go to page.aspx?var1=one&amp;va­r2=two
     
    Request.QueryString interprets "amp;va­r2" as a variable
  •  06-05-2009, 8:47 AM 52823 in reply to 52822

    Re: SetHTML UrlEncoded not properly

    Thanks Kenneth, it works perfectly :)
View as RSS news feed in XML