Convert BBCode to HTML

Hi guys

I hope you can help.

Basically, I allow my users to add BBCode to a field in my database table. They are able to do this by adding their code to a on my ASP page. An example of what they include can be seen below:

[center][size=3][b]This is my title[/b][/size][/center] Give it a try! [color=#ff0000]Red text! [/color][color=#3399ff]Blue text[/color] [ul] [li]A simple list[/li] [li]list item 2[/li] [/ul] some more text [b] and more text in bold[/b]

The problem I have is that I now want to display this on my asp page but convert it to HTML. So, in this example the text is centred, bolded, different colours, in lists etc etc.

Currently, I use <%=bbcode%> tp pull in the data into my page. However, it just shows the text in its raw format. What I need is it to render in html so I don’t just get text but the actually text have html elements.
Is this possible? If so, how would I achieve this in my asp page? Any help would be fully appreciated.

Best regards

Rod from the UK

I have not touched ASP since the days before ASP.Net
However, I have been using C# since it was introduced.

A quick Google search revealed this which appears promising.

Thanks ParkinT

I have worked on a function that turns BBCode to HTML but I’m having problems with nested tags. I have created a new thread outlining my issue and have had some replied (including yourself) but it would appear that what I need to do is not possible?

Thanks again

Best regards

Rod form the UK

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.