Project Description
BBCode for ASP.NET, C#, VB.NET. Convert BBCode to Html.

Note: There is Another Better Option

After I have written this project, then later I found another better well developed tool:

Codekicker.BBCodehttps://bbcode.codeplex.com/

Codekicker.BBCode is better than this, more mature than this. If you are going to use a ASP.NET BBCode Engine in production, you are strongly recommended to use Codekicker.BBCode.

Why Use Codekicker.BBCode?

Codekicker.BBCode is.....

  • Far more stable than this.
  • Safe - it does not let through unsafe HTML like <script> under any circumstances
  • Good Performance - it is meant to be used in production
  • Easy to use - Just call BBCode.ToHtml("[url=http://codekicker.de]codekicker[url]")
  • Customizable - Customizing the translation of every tag is easy and flexible
  • Error messages - the messages are available in english and german. Language contributions are welcome.

 

Alternative Pre-Defined BBCode Parser: http://eksith.wordpress.com/2009/01/14/aspnet-bbcode-c

 


This project is not deleted or abandoned as it may serves for research and study purposes. 

Using BBCode.NET (this project)

BBCode.Net converts this:

[url=http://www.codeplex.com]Codeplex[/url]

into this:

<a href="http://www.codeplex.com">Codeplex</a>

Coding Example:

string BBCodeSyntax = "[url={webaddress}]{display}[/url]"; 
string HtmlSyntax = "<a href=\"{webaddress}\">{display}</a>"; 
string Fields = "{webaddress};{display}"; 
string input = "Project Hosting for Open Source Software - [url=http://codeplex.com]Codeplex[/url]";  

string output = BBCode.ConvertToHtml(input, BBCodeSyntax, HtmlSyntax, Fields);

Respond.Write(output);

Prevention of XSS Attack

BBCode.Net is currently not able to block XSS Attack (Cross-site Scripting). You have to implement your own AntiXSS engine. There is a nice AntiXSS engine provided by Microsoft (Read more: Microsoft Web Protection Library)

Read more about XSS Attack (Cross-site Scripting)

Last edited May 13 at 3:46 PM by adriancs, version 22