Brockmann: "Creating Rich Web
Applications Gets a Ton Easier"

e-grou chooses Visual WebGui
over standard ASP.NET

Quick migration of VB 6.0
Applications to the Web

Fully functional software versions
for 30 days evaluation period

Download the free edition of the
Visual WebGui Studio
 

Code Snippets

tamir.zaslavsky posted on November 22, 2007 :: 3964 views

DNN architecture provides a way to extend your site via DNN modules.

The following code was developed and tested on DNN 03.03.07 (.NET 1.1) and 4.7 (.NET 2.0)

What Are Modules?

Modules provide developers with the ability to extend the functionality of DotNetNuke. DotNetNuke provides a pluggable framework that can be expanded by the development of modules. A module container is provided by DotNetNuke to host a custom module. Modules can be developed in any .NET language, even though DNN is developed in VB.NET, a C# developer can still create a module that plugs into the core framework provided by DNN. This pluggable framework is accomplished by creating compiled private assemblies that expose and utilize interfaces specific to DNN. Once you compile the assembly, and then just create a UI in the form of ascx files that allow your user to interact with your module.
(From http://www.wwwcoder.com/Directory/tabid/68/ctl/Terms/Default.aspx)

We created a DNN module that hosts Visual WebGui Application via FormBox control. Here are instructions to install it:

1.       Download the Attached zip file and unzip it.

2.       Logon to your DNN site with host permission.

3.       Install module Gizmox.WebGUI.DNNHostModule:

Navigate to HostàModule DefinitionsàInstall New Module.  Browse Gizmox.WebGUI.DNNHostModule_01.00.00_Install.zip file, and click the "install new module" link.

4.       Add your own VWG application to the DNN.
You have do it in two way:

4.1.    Manually – add your VWG application assembly (the DLL file) to the bin directory of the DNN application.

4.2.    Create DNN module that do exactly step 4.1. 

Why should you go all the trouble to create DNN module that do that simple task? 

First, maybe you don't have direct access to the file system, or maybe your customers don’t have. Second, this is very simple task!

Create text file with ".dnn" extension with the following content:

<dotnetnuke version="3.0" type="Module">
  <folders>
    <folder>
      <name>YourModuleName</name>
      <version>01.00.00</version>
     <files>
        <file>
          <name>YourVWGApplication.dll</name>
        </file>
      </files>
    </folder>
  </folders>
</dotnetnuke>

for DNN 3.X (.Net 1.1) and DNN 4.X (.Net 2.0) the content above is a bit different.
see VWGSampleAppModule.dnn file inside both VWGSampleAppModule_DOTNET11_01.00.00_Install.zip and VWGSampleAppModule_DOTNET20_01.00.00_Install.zip files

Create a zip file that contains the ".dnn" file and also the YourVWGApplication.dll file. To install your module, repeat step 3 for the zip file you created.
I also added VWGSampleAppModule_DOTNETXX_01.00.00_Install.zip as an example to this step (4.2).

5.       Add "instances" of  Gizmox.WebGUI.DNNHostModule  to the DNN site.

After you install dnn module you can add "instances" of it to the DNN site. Obviously you'll want to add at least one.

6.       Configure VWG:
Like regular VWG application, you'll need to add some configurations the web.config file. Again, like step 4 it can be done in two ways:

6.1.    Manually:
Edit web.config file and add the VWG configuration data.

6.2.    Automatically:

Navigate to page that contains "instance" of  Gizmox.WebGUI.DNNHostModule .

If VWG configuration data is missing in the web.config file, (and it probably is)

The "Edit Global VWG host module configuration" control will appear automatically instead of the control that hosts the VWG Application. You'll probably want to edit the <Applications> element to configure entry point for the VWG application. If you installed my sample module (VWGSampleAppModule_DOTNETXX_01.00.00_Install.zip') then insert  <Application Code="MainForm" Type="VWGSampleApp.MainForm, VWGSampleApp"/> to the <Applications> element.

Don’t forget to click 'update' when you finish. If you want to reconfigure it later, click the "Edit Global VWG host module configuration" link at the bottom of the control that hosts the VWG Application.

7.       Configure each of the "instances" of Gizmox.WebGUI.DNNHostModule you added.
Each instance need to be mapped to a VWG entry point (that was configured via <Application> element in web.config.) .click the "Edit this Form Box" link at the bottom of the control that hosts the VWG Application, again don’t forget to click 'update' when you finish. If used my sample module ('VWGSampleAppModule_DOTNETXX_01.00.00_Install.zip') then enter  MainForm  in the "Form" TextBox

That’s it, Enjoy (:

Tamir Zaslavsky

Download Code

Note: Codes are submitted as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Terms of Agreement:
By using this code, you agree to the following terms...

  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame.
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

Post Rating

Comments

# pennmike
I was unsuccessful at getting this to work. The install errored out on VWGConfiguration.cs, not sure how you got the cs code file to work on DNN being that it's a vb app. Can you help me?
Posted by pennmike on Sunday, January 06, 2008 10:35 AM
# jpettit
I also experienced problems installing via the module package. The problem was with being able to create the folder in the App_Code folder. I was able to get it installed manually by modifying the DNN file, but then get errors from the module instances on pages. Errors are then with VWGConfiguration.cs in being able to find nodes from the web.config.
Posted by jpettit on Friday, February 29, 2008 4:25 PM
# mebet
How can i inherits the security from dnn.
Posted by mebet on Thursday, July 31, 2008 9:17 PM
# jlam
How can i inherits the security from dnn?


Posted by jlam on Saturday, November 15, 2008 7:20 PM
# stevefinn
Is there any plans to release a version of this for .NET 3.5?
Posted by stevefinn on Saturday, June 06, 2009 9:33 AM

Post Comment

Only registered users may post comments.
Most promising startups
Top 3 most promising startups in 2009
   AJAX Framework | Web Development | Cloud applications | RIA Development | Silverlight Applications | Legacy Migration
The most popular open source Ajax applications framework for enterprises | Sitemap | Terms Of Use | Privacy Statement
Copyright © 2005-2009 Visual WebGui®    Design By: Template World
   
Visual Studio Partners