你知道任何开源的asp.net web控件来呈现代码吗?

时间:2021-12-27 15:25:07

I'm looking for an asp.net control capable of formatting code written in certain programming languages (as in * or the "Language" functionality in Notepad++), with automatic syntax highlighting/indentation depending on the language.

我正在寻找能够格式化用某些编程语言编写的代码的asp.net控件(如*或Notepad ++中的“语言”功能),并根据语言自动语法高亮/缩进。

Do you know of any such control?

你知道有这样的控制吗?

1 个解决方案

#1


I don't know any asp.net control that does that, but you could use a JavaScript syntax highlighter, like this one : http://code.google.com/p/syntaxhighlighter/.

我不知道这样做的任何asp.net控件,但您可以使用JavaScript语法高亮显示器,如下所示:http://code.google.com/p/syntaxhighlighter/。

The main advantage is that it moves the rendering cost to the client side, which can be a huge gain for a highly-frequented website with a lot of code (eg programming forum/website like SO.. wait... they do that too, right ?).

主要优点是它将渲染成本转移到客户端,这对于拥有大量代码的高频率网站来说是一个巨大的收获(例如编程论坛/网站,如SO ..等等......他们也这样做, 对 ?)。

#1


I don't know any asp.net control that does that, but you could use a JavaScript syntax highlighter, like this one : http://code.google.com/p/syntaxhighlighter/.

我不知道这样做的任何asp.net控件,但您可以使用JavaScript语法高亮显示器,如下所示:http://code.google.com/p/syntaxhighlighter/。

The main advantage is that it moves the rendering cost to the client side, which can be a huge gain for a highly-frequented website with a lot of code (eg programming forum/website like SO.. wait... they do that too, right ?).

主要优点是它将渲染成本转移到客户端,这对于拥有大量代码的高频率网站来说是一个巨大的收获(例如编程论坛/网站,如SO ..等等......他们也这样做, 对 ?)。