can't land my caustom control on master page

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.
12/22/2011 5:22:04 AM
Gravatar
Total Posts 87

can't land my caustom control on master page

Hi, 

i've made custom control (custom search box) and placed it on master page in heade, everythin works great BUT now i noticed strange thing - it works ok for not logged in user, but when i login (in IE or opera) i get this error in logs:

2011-12-22 11:16:07,991 ERROR 80.193.48.103 - en-GB - /Secure/Login.aspx - mojoPortal.Web.mojoBasePage - 80.193.48.103-en-GB - /Secure/Login.aspx
System.NullReferenceException: Object reference not set to an instance of an object.

and row referred is simple base.OnInit(e);

protected override void OnInit(EventArgs e)
{
base.OnInit(e);
}

my control is inherited from mojoPortal.Web.SiteModuleControl and i can't understand what i'm doing wrong - it works in google chrome for logged in user (but the user authorization cookie was set long time ago before i added this control may be this why it still works?)

Regards,

Victor

12/22/2011 5:40:28 AM
Gravatar
Total Posts 18439

Re: can't land my caustom control on master page

SiteModuleControl is a base class for custom modules that plug into the content system, it is not something designed for embedding directly in layout.master. Modules that plugin to the content system have a moduleid and pageid associated with them when they are added to a page through the content system and they do not appear on non cms pages such as the login page.

You can embed a custom UserControl in layout.master but if your goal is to put it directly in layout.master it probably should not inherit from SiteModuleControl which is designed for content system plugins.

Hope that helps,

Joe

12/22/2011 5:46:48 AM
Gravatar
Total Posts 87

Re: can't land my caustom control on master page

Thank you, I see.

I inherited it to get easy access to sitesettings. But now I will inherit it from UserControl and will take site settings form 

SiteSettings sset = mojoPortal.Business.WebHelpers.CacheHelper.GetCurrentSiteSettings();

it seem to work.

Thank you.

Regards,

Victor

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