Inline Code Sample

This page shows how you can simply create a CodeHighlighter control. Place text code within the CodeHighlighter tags and it will be syntax highlighted in the rendered output.

In the following sample, some CSS code is placed directly within the CodeHighlighter tags to produce syntax highlighted CSS.

1 A { 2 color: #336699; 3 text-decoration: none; 4 } 5 6 A:Hover { 7 color: #DD6900; 8 text-decoration: underline; 9 } 10 11 BODY { 12 background-color: White; 13 color: Black; 14 font-family: Tahoma, Verdana, Sans-Serif; 15 margin: 0px; 16 }

This is the code that produced the above block of syntax highlighting. Easy, isn't it?

1 <pre><CH:CodeHighlighter runat="server" ID="CodeHighlighter1" LanguageKey="CSS">A { 2 color: #336699; 3 text-decoration: none; 4 } 5 6 A:Hover { 7 color: #DD6900; 8 text-decoration: underline; 9 } 10 11 BODY { 12 background-color: White; 13 color: Black; 14 font-family: Tahoma, Verdana, Sans-Serif; 15 margin: 0px; 16 }</CH:CodeHighlighter></pre>

CodeHighlighter now supports keyword linking. You can make collections of keywords in your web.config file to link to various URLs. Check out the links for CodeHighlighter and Actipro that are auto-generated by the CodeHighlighter engine:

1 CodeHighlighter is a great ASP.NET control made by Actipro Software.

 
Code Highlighter - Copyright © 2004-2006 Actipro Software LLC. All Rights Reserved.