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

HomeHomeDevelopment and...Development and...Getting StartedGetting Startedload filemanager from my module at runtimeload filemanager from my module at runtime
Previous
 
Next
New Post
1/29/2012 2:25 PM
 

Sorry that i mislead you. I had overlooked the fact that the FileManager is located within the DotNetNuke website which is a just-in-time compiled website project (WSP). So, while you can load the module control using LoadControl, you cannot cast it to it's actual class type, DotNetNuke.Modules.Admin.FileManager.FileManager. Nor is it possible to add in your module project a reference to the DotNetNuke website project.

The only way that I see you might accomplish this, and I havn't tried it nor can really recommend it, is to make your custom module a WSP in the the DotNetNuke webspace. It would then be compiled just-in-time along with the DotNetNuke website as opposed to being a pre-compiled website application project (WAP). It would not have it's own project file (csproj or vbproj). Instead of doing a LoadControl in code, your module control (ascx) would then include a reference to the FileManager.ascx an <% @Register . . .%> directive as follows:

<%@ Control language="cs" Inherits="MyCompany.MyModule" CodeFile="MyModule.ascx.vcs" AutoEventWireup="false"  %>
<%@ Register TagPrefix="dnn" TagName="FileManager" Src="~/DesktopModules/Admin/FileManager/FileManager.ascx"  %>

<div>
    <dnn:FileManager id="ctlFileManager" runat="server" ></dnn:FileManager>
</div>

You should then be able to reference the properties of the ctlFileManager object in your CodeFile (rather than CodeBehind - same idea but different terminology for a WSP project).

I mentioned that I consider the reuse of DNN module controls as user controls in one's own projects as being a "bit on the edge of good practice" for the following reasons:

  • Unlike core user controls such as the UrlControl, Label, etc, the module controls were never designed to be incorporated into other module controls.
  • Since the control is not designed for other usage its entire design, namespace, properties, etc. might change in a later version rendering your module control useless.
  • In the case of this specific module control which relies heavily on client-side code for the folder tree I suspect that you may run into some problems with missing client side script registration as well as permissions if the control is to be used by non-admin users. Not impossible to work around but an additional layer of complexity.

As for other approaches, it depends on what you are trying to accomplish with your module. If you are looking for only a subset of the functionality of FileManager - for example file upload or displaying a list of files in a folder, you are better to use other controls such as the UrlControl, DnnFilePicker, etc. and to study the source code of the FileManager for ideas on how to accomplish your specific needs.

 

 


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
1/29/2012 3:41 PM
 
so explanatory. thank you very much.  now i know a bit more. (that at the end is what i was looking for)
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting Startedload filemanager from my module at runtimeload filemanager from my module at runtime


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