Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How to display code safely and graphically?How to display code safely and graphically?
Previous
 
Next
New Post
5/16/2008 5:43 AM
 

Hi all,

I'd like to know how I can display HTML, ASP.Net, JS code, etc safely and graphically, like on this page?

Thanks,

Duc

 
New Post
5/16/2008 11:22 AM
 

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

 
New Post
5/16/2008 11:29 AM
 

I'm not the original poster/questioner, but just wanted to say: very nice, helpful response! Thanks!

CT


CT
 
New Post
5/16/2008 11:54 AM
 

I personally use a formatter available here http://www.carlosag.net/ 


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
5/16/2008 12:06 PM
 

Thanks all for your help!

Fabian, very detailed answer. Much appreciated.

Duc

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How to display code safely and graphically?How to display code safely and graphically?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out