how to inheriate mojoBasePage from page in new custom project

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.
2/7/2010 9:30:26 PM
Gravatar
Total Posts 5

how to Inherit mojoBasePage from page in new custom project

Trying to get a grip on how to develop custom components in a separate project. 

Probably answered in video http://www.mojoportal.com/training/mojoportal-sourcecode-overview/

but it has been down at least a day. Anyone know where else I could find this video?

I did look at video http://www.mojoportal.com/flashtutorials/mojo-webstore-solution-setup/mojo-webstore-solution-setup.html  but is stopped short of showing how to create a page in new project that inherites mojoBasePage.

What I have done.  Create VB project.  added references and imports to

  • mojoPortal.Business
  • mojoPortal.Business.WebHelpers
  • mojoPortal.Web
  • mojoPortal.Web.Controls
  • mojoPortal.Web.Framework

In the code behind for the page it looks like

Partial Public Class otp_UserHome
  Inherits mojoBasePage
...

What am I doing wrong?

2/8/2010 7:04:44 AM
Gravatar
Total Posts 18439

Re: how to inheriate mojoBasePage from page in new custom project

Hi,

I plan to do a new series of videos on this soon. However I will be showing it in C#.

This blog post by Steve Land may help some in the mean time.

http://techblog.strongeye.com/archive/2009/12/16/creating-a-mojoportal-module.aspx

In addition to changing the the code behind you have to also change the .aspx part of the page.

I have a Codesmith script you can use to generate a starter page both .aspx and .c codebehind but it is for C#. Maybe you could modify it for VB.NET.

If you look in the source code under /CodeSmithTemplates you'll find a .zip with an older freeware version of Codesmith (in case you don't have the new version). Many of my scripts including the one for generating starter pages can work in the old freeware version.

Best,

Joe

2/9/2010 7:45:30 PM
Gravatar
Total Posts 9

Re: how to inheriate mojoBasePage from page in new custom project

I'd love to see more videos on this.  Honestly, I'm a fairly new developer and I'm struggling through some of the same issues.


It just takes time and keep pluggin' away at it.

2/13/2010 9:49:27 PM
Gravatar
Total Posts 5

Re: how to Inherit mojoBasePage from page in new custom project

#region OnTryToGetItToWork
   // many hours of ... fun
#endregion

 

I did finally get a page to inherit from mojoBasePage and thus get a custom module to work.  I believe the problem was something to do with the pages section of the web.config.  I watched Joe's videos, which were helpful until they got out of sync, and then used Steve Land's blog

http://techblog.strongeye.com/archive/2009/12/16/creating-a-mojoportal-module.aspx

I did have to make some changes to the steps when I encountered problems with the TitleControl not seeing the referenced namespaces.  FWIW here is what I did differently.

C#

in Step 2 ==> Update Web.Config
moved pages section to the first child node in system.web and delete the pages section already there further down.

in Step 2 ==> Copy Master Pages
change the name space in the layout.Master code behind to [yourproject].UI

in Step 3 ==> Generate ascx from CodeSmith template
added "protected ModuleTitleControl TitleControl;" to code smith generated code for module as recomended by BidNo in another forum thread.

VB

to make it work in VB follow same steps (including modifications listed above)
in Step 3
   after ==> Generate ascx from CodeSmith template
   and before ==> Cut and paste back into your Module

convert C# code to VB
make sure you change the <%@ Control … %> attributes for VB
Also make sure to add "Protected TitleControl As New ModuleTitleControl" scoped to the class.

in the second Step 3 ==> Open the Properties of your .UI project
the post build events is on the Compile tab. Click the 'Build Events...' button.

After that every thing worked fine.

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