There are a number of solutions.
1. the easiest is to wrap your text in a 'code' or 'pre' or 'xmp' tag. Try each one to see how it works for you. Here's a sample wrapped in a xmp tag
Dim UserController As New DotNetNuke.Entities.Users.UserController()
Dim User As DotNetNuke.Entities.Users.UserInfo = UserController.GetUser(PortalId, UserId, False)
2. place your code in an embedded table. This is the table html snippet that I use when posting code.
<table style="BORDER: 1px solid red; BACKGROUND-COLOR: #ffffeb" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td style="FONT-SIZE: 8pt; COLOR: #cc0000; FONT-FAMILY: 'Courier New'">
</td>
</tr>
</tbody>
</table> |
Using that HTML snippet ( I have it in a Vista sidebar notepad gadget, so all I need to do when posting is click on the gadget, Select All, Copy, then come back to the DNN form or Blog, switch the display to "Source Code", Paste it .. then switch base to RTE and paste my source into the table cell ) the final result looks like this...
Dim UserController As New DotNetNuke.Entities.Users.UserController()
Dim User As DotNetNuke.Entities.Users.UserInfo = UserController.GetUser(PortalId, UserId, False) |
3. another option is a Visual Studio Macro that is available on the web called FormatToHTML, which maintains your Visual Studio color highlighting...
Dim UserController As New DotNetNuke.Entities.Users.UserController()
Dim User As DotNetNuke.Entities.Users.UserInfo = UserController.GetUser(PortalId, UserId, False)
|
You can dowload the FormatToHTML macro here ...
http://www.codinghorror.com/blog/archives/000429.html
There are also some links on that page to other source formatting options for web pages .. as you can imagine, there are quite a few choices.. try a few and just use whatever works best for you