Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

PortalWebHosting
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
r2i.ntegrated
 


  Sponsors  

Meet Our Sponsors

eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Chat About It!  How to display code safely and graphically?
Previous Previous
 
Next Next
New Post 5/16/2008 2:43 AM
User is offline duchoangle
447 posts
vn.pijaja.com
8th Ranked


How to display code safely and graphically? 

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


Pijaja.Com - Innovative Site Builder

Sirius - Free skin for Dotnetnuke

 
New Post 5/16/2008 8:22 AM
User is offline Steve Fabian
1318 posts
6th Ranked








Re: How to display code safely and graphically? 
Modified By Steve Fabian  on 5/16/2008 11:27:01 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


Steve Fabian
Gooddogs.com
Sit, Stay, Code ... Good boy!
 
New Post 5/16/2008 8:29 AM
User is offline CT
50 posts
10th Ranked


Re: How to display code safely and graphically? 

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

CT


CT
 
New Post 5/16/2008 8:54 AM
User is offline Mitch Sellers
5026 posts
www.mitchelsellers.com
3rd Ranked




Re: How to display code safely and graphically? 

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


-Mitchel Sellers
MCITP, MCPD, MCTS
Director of Development
IowaComputerGurus Inc.
View Mitchel Sellers's profile on LinkedIn

Visit mitchelsellers.com for DotNetNuke tutorials, modules and technical help

Custom DotNetNuke Services Available (Development, etc).

My sites are hosted with 3Essentials
 
New Post 5/16/2008 9:06 AM
User is offline duchoangle
447 posts
vn.pijaja.com
8th Ranked


Re: How to display code safely and graphically? 

Thanks all for your help!

Fabian, very detailed answer. Much appreciated.

Duc


Pijaja.Com - Innovative Site Builder

Sirius - Free skin for Dotnetnuke

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Chat About It!  How to display code safely and graphically?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


DNN Photo Gallery
DNN Photo Gallery is a truly unique photo management module released January 1st 2006. With DNN Photo Gallery you can REALLY integrate images into your existing portal and make them look like they were designed for your site.
DNN Photo Gallery
Swirlhost Inc.
Affordable DotNetNuke Hosting, Skin Development, Custom Module Development, and DotNetNuke Consulting. We will install your preference of DNN and now host with us and get a free license for the Swirl AJAX Chatroom Module.
www.swirlhost.com
Active Modules, Inc.
Creators of Active Forums, the best forum module for DotNetNuke
www.activemodules.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP