Wednesday, 23 March 2011

How to insert one DNN module into another

This is not common task between different modules. But it is good to use controls inside of single project and this is very popular. So, to add one module to another you just need to know name of the primary control. Then your form will be like this:
<%@ Register TagPrefix="dnn" TagName="MultiEdit" Src="~/DesktopModules/dnn.MultiEdit/MultiEdit.ascx" %>
<dnn:multiedit id="objMultiEdit" runat="server"></dnn:multiedit>

Hope this helps!

4 comments:

  1. Hi,

    I embedded a module in another module this way, but I cannot access the methods in the child module....is there a way to do this?

    Thanks!

    ReplyDelete
  2. Vanessa

    Yes, its possible. You have to make methods public. Also you have to cast type of your control, for example like this:

    ((MultiEdit) objMultiEdit).MyPublicProperty = true;
    ((MultiEdit) objMultiEdit).MyPublicMethod_01();
    ((MultiEdit) objMultiEdit).MyPublicMethod_02();

    Hope this helps.

    ReplyDelete
  3. Hi,

    I need to display the contents of an HTML module on my homepage and insert it into a table I have in an HTML module on another page.

    Is there a way to do this without going deep into the code?

    ReplyDelete
  4. Hi Mark

    You can insert exactly the same HTML module at the other pages you need, but it is impossible to do with partial content (only with custom development).

    Sergey

    ReplyDelete

Note: only a member of this blog may post a comment.