Re: Insert asp code in editor 4 for asp

  •  02-17-2006, 9:31 AM

    Re: Insert asp code in editor 4 for asp

    Some further information:

    lkelly's approach, while sensible, is causing some funny behavior inside the class.  Merely the existence of asp tags, even inside comments, appears to cause a large number of line breaks to be inserted into the output.  These are just physical CrLfs, not <br> tags, but it still makes the resultant html very messy.

    My add-on was to do a search inside each tag to disable the comment marks inside ASP tags, but with the above behavior, it would not be feasible.  The editor pokes so many line breaks into the output that any attempt to reassemble would be unreliable at best.

    For now, I've written a search on <% in the content, and locked out any browser other than IE if the content contains one.  That won't work very long, because I have a large client who wants to use Firefox for the editing.  By doing some tricky manipulating of content blocks, I can code around most areas where ASP tags are used, but not all -- and it is highly labor-intensive to do so.

    If I may make a suggestion, it seems the correct behavior would be:

        if in normal view, show a placeholder tag, such as <% CODE HERE %> with highlighting as Read Only, and skip without displaying from <% to %> while preserving literal content untouched.
        if in html view (and code editing enabled,) display asp tag (<% to %>) untouched, but allow editing.
        if in html view (and code editing NOT enabled,) display a placeholder tag, such as <% CODE CANNOT BE EDITED %> as Read Only.
        if in Preview mode, show a placeholder tag, such as <% CODE HERE %> with highlighting.

    I haven't looked inside the class to see what you are using to control the content flow, but there is (hopefully) a way to mark a a string to be preserved exactly within the manipulations for various displays and output.

    Thanks again for your product.
    Vivamus


View Complete Thread