ModuleWrapper in layout.master

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
1/18/2009 11:48:26 PM
Gravatar
Total Posts 5

ModuleWrapper in layout.master

I have developed a custom module, and successfully installed it in the portal.  I want this module to appear on all of my pages, and I have tried using the portal:ModuleWrapper control in my layout.master file.  However, I can't seem to locate the ModuleId.  Looking in the database, in [mp_Modules], I see the module, but plugging in that Id causes a null reference exception.  Obviously I'm doing something wrong or looking at the wrong Id.

Thanks,
-Damien

1/19/2009 5:12:16 AM
Gravatar
Total Posts 18439

Re: ModuleWrapper in layout.master

Hi Damien,

It should work as long as your module control inherits from SiteModuleControl. I will update modulewrapper so it can work with a UserControl for the next release but currently it only supports SiteModuleControl.

Hope it helps,

Joe

1/19/2009 8:19:28 AM
Gravatar
Total Posts 5

Re: ModuleWrapper in layout.master

Joe,

Thanks for the quick response.  I'm using the Inline code method as shown in your example here: http://www.mojoportal.com/usinginlinecode.aspx.  I've tried it with my control and your HelloMojo ASCX control.

Here's my process:

  1. I added the control to the /Modules folder
  2. Installed the feature using Feature Admin
  3. Created new content based on the control
  4. Added <portal:ModuleWrapper ID="m11" runat="server" ConfigureModuleID="11" /> to the layout.master, where ModuleID=11 came from the [mp_Modules] table.
  5. Error:
    2009-01-19 09:13:31,459 ERROR mojoPortal.Web.mojoBasePage - 192.168.1.1-en-US - /Mojo/home.aspx
    System.NullReferenceException: Object reference not set to an instance of an object.
    at mojoPortal.Web.ModuleWrapper.LoadModule()
    at mojoPortal.Web.ModuleWrapper.set_ConfigureModuleId(Int32 value)
    at ASP.data_sites_1_skins_mySkin_layout_master.__BuildControlm11()
    at ASP.data_sites_1_skins_mySkin_layout_master.__BuildControldivCenter()
    at ASP.data_sites_1_skins_mySkin_layout_master.__BuildControlfrmMain()
    at ASP.data_sites_1_skins_mySkin_layout_master.__BuildControlTree(data_sites_1_skins_mySkin_layout_master __ctrl)
    at ASP.data_sites_1_skins_mySkin_layout_master.FrameworkInitialize()
    at System.Web.UI.UserControl.InitializeAsUserControlInternal()
    at System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection)
    at System.Web.UI.Page.get_Master()
    at mojoPortal.Web.UI.Pages.SiteHome.SetupMasterPage()
    at mojoPortal.Web.UI.Pages.SiteHome.OnPreInit(EventArgs e)
    at System.Web.UI.Page.PerformPreInit()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Is there something I'm missing in the code that needs to be added in order for this to work? 

Thanks again for your help.
-Damien

 

 

 

1/19/2009 8:23:25 AM
Gravatar
Total Posts 18439

Re: ModuleWrapper in layout.master

Sounds like possibly a bug, I have not tried the modulewrapper in a while. I'll investigate as soon as I can.

Best,

Joe

1/19/2009 11:06:58 AM
Gravatar
Total Posts 18439

Re: ModuleWrapper in layout.master

I confirm this as a bug. I've fixed it in my copy so it will be fixed in the next release.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.