This is a migrated thread and some comments may be shown as answers.

Highlighted Syntax

4 Answers 48 Views
Code Converter
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Padgett
Top achievements
Rank 1
Padgett asked on 29 Jan 2008, 06:39 AM
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.

4 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 29 Jan 2008, 07:39 AM
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
0
Padgett
Top achievements
Rank 1
answered on 29 Jan 2008, 08:35 AM
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
0
Todd Anglin
Top achievements
Rank 2
answered on 06 Feb 2008, 05:57 PM
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
0
Padgett
Top achievements
Rank 1
answered on 07 Feb 2008, 12:18 AM
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.
Tags
Code Converter
Asked by
Padgett
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Padgett
Top achievements
Rank 1
Todd Anglin
Top achievements
Rank 2
Share this question
or