RSS Feed Available AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  

Did you know Active Forums can format code?

by Will M on 05 Apr 2007 05:18 PM

I have been "lurking" on several forums lately learning about what people think about Active Forums and how it compares to other forum modules for DotNetNuke.  One thing I have learned is that we don't do a very good job describing all the capabilities of Active Forums. 

Over the next few days I plan to post a series of "Did you know" articles which describe some of this undocumented or less well know features.  I'll begin with code formatting.

Active Forums will automatically format code for you similar to what you see in Visual Studio.  All you need to do is wrap your code with < code > < /code > tags and it will format everything in between.  For example...
Hello World!

If you are using an HTML editor you will want to switch to HTML view to enter your code. 

    5 Comments for Did you know Active Forums can format code?

    Will Morgenweck
    Will Morgenweck
    05 Apr 2007 05:21 PM
    www.activemodules.com
    Quick Reply or the Plain Textbox option actually works best for handling code formatting since most of the HTML Editors will try to do something different with your code.

    Same code block from above this time using Quick Reply
    Hello World!

    Will Morgenweck
    Will Morgenweck
    05 Apr 2007 05:25 PM
    www.activemodules.com
    You can also specify the language to be VB.NET.
    Public Sub HelloWorld() Response.Write("Hello World") End Sub
    Will Morgenweck
    Will Morgenweck
    05 Apr 2007 05:29 PM
    www.activemodules.com
    The syntax below is an example of specifying VB code.

    Public Sub HelloWorld() Response.Write("Hello World") End Sub
    Will Morgenweck
    Will Morgenweck
    05 Apr 2007 05:43 PM
    www.activemodules.com
    Here is a copy and paste from the DotNetNuke keepalive.aspx.vb file
    ' ' DotNetNuke® - http://www.dotnetnuke.com ' Copyright (c) 2002-2006 ' by DotNetNuke Corporation ' ' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated ' documentation files (the "Software"), to deal in the Software without restriction, including without limitation ' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and ' to permit persons to whom the Software is furnished to do so, subject to the following conditions: ' ' The above copyright notice and this permission notice shall be included in all copies or substantial portions ' of the Software. ' ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ' DEALINGS IN THE SOFTWARE. ' Namespace DotNetNuke.Common.Utilities Partial Class KeepAlive Inherits System.Web.UI.Page #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. Private Sub InitializeComponent() End Sub Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here End Sub End Class End Namespace
    Will Morgenweck
    Will Morgenweck
    05 Apr 2007 05:46 PM
    www.activemodules.com
    Code formatting has been a feature since Active Forums 3.0.  I hope you find this useful.

    Thanks,
    Will
    test
    Copyright 2012 by DotNetNuke Corporation / Terms of Use / Privacy