Highlighted Syntax

5 posts, 0 answers
  1. Padgett
    Padgett avatar
    3 posts
    Member since:
    Jun 2007

    Posted 29 Jan 2008 Link to this post

    I'm curious to know how you achieved the Highlighted Syntax::Formatted Results tab?  Is this possible with the out of the box Telerik asp.net web controls?

    It apears the 'Open Source' tag is somewhat misleading as the source for the asp.net version is not available.
  2. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 29 Jan 2008 Link to this post

    Hello Padgett,

    Consider using the FormatCodeBlock dialog of our editor control to apply different formats to the code snippets entered by the user. Review the online demo linked below for more info:

    http://www.telerik.com/DEMOS/ASPNET/Prometheus/Editor/Examples/XhtmlValidatorTrackChangesFormatCodeBlockDialogs/DefaultCS.aspx

    Best regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Padgett
    Padgett avatar
    3 posts
    Member since:
    Jun 2007

    Posted 29 Jan 2008 Link to this post

    Hi Stephen,

    This isn't quite what I'm looking for.  I'd like the rendered result, not a dialog.  I'd like to be able to do something like this:

    TelericHtmlFormatter.Text = GetLargeBlockOfText;
    TelericHtmlFormatter.FormatType = FormatType.Css;
    TelericHtmlFormatter.Render();

    Where I supply the text block, the systax format type and have it render the block of code whereever the <Teleric:HtmlFormatter /> tag is in my asp.net page.

    Cheers,
    Padgett
  4. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 06 Feb 2008 Link to this post

    Padgett-

    The syntax highlighting being done in the Converter is using an engine very similar to what's in RadEditor. That said, I'm not sure how "open" it is; I'll have to follow-up and see if I can make the code available to you. I agree that the Open Source title is misleading- it really should be more like "Community Projects."

    As for a Telerik control that directly provides this functionality, I think the RadEditor is the closet that exists. I'll talk to the Editor team to see if they can expose any more functionality for the Code Formatter via the API, as that is a good suggestion.

    You might check out the free syntax highlighting control from Actipro, too, to see if that solves your problem:

    http://www.actiprosoftware.com/Products/DotNet/ASPNET/CodeHighlighter/default.aspx

    Hope that helps.

    -Todd
  5. Padgett
    Padgett avatar
    3 posts
    Member since:
    Jun 2007

    Posted 06 Feb 2008 Link to this post

    Cheers Todd, I'll keep an eye on the next few releases of the rad editor.  In the mean time the freebie control you linked to looks like it will do the job.
Back to Top