If you post source code to the Web, you simply *must* download Wilco Bauwer's SyntaxHighlighter. It's an ASP.NET control that formats, colourizes and generally makes said code look good. Incredibly easy to use as well -- register the control (Oh, did I mention he ships the source?), and add one or more of the controls to your page:
language="ASPX" mode="Source" text='Your source code here' />
(Please forgive the fact that I'm not actually using the control in this post, but I wanted to post about it before I got around to installing it on my server)
That 'language' parameter doesn't have to be ASPX either, as he does code formatting for ASP.NET, CSS, XML, SQL, C#, VB files (as well apparently as C, COBOL, Cold Fusion, C++, Eiffel, Fortran, Haskel, Java, JavaScript, Mercury, MSIL, Pascal, Perl, PHP, Python, Ruby and VBScript). You can see this control in action on the CSS Adapters section of the ASP.NET site.
(Mental note: for VB syntax highlighting, the language needs to be set to 'VisualBasic' (not case sensistive). I'm sure I'll forget that in a bit, so I'll leave it here for me to find.)
Print | posted on Tuesday, June 06, 2006 6:51 AM