htmlmodule

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.
3/17/2008 6:04:06 AM
Gravatar
Total Posts 13

htmlmodule

Hi,

i want to clone the htmlcontent module, but i don't be able to create the reference to file HtmlContentIndexBuilderProvider.cs.

i have the follow sever error:

Unable to cast object of type 'mojoPortal.Business.CartanetContent' to type 'mojoPortal.Business.HtmlContent'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Unable to cast object of type 'mojoPortal.Business.CartanetContent' to type 'mojoPortal.Business.HtmlContent'.

Source Error:


Line 106: ContentChangedEventArgs e)
Line 107: {
Line 108: HtmlContent content = (HtmlContent)sender;
Line 109: if (e.IsDeleted)
Line 110: {
 

Source File: C:\mojoportal\mojo\mojoPortal.Business.WebHelpers\IndexBuilders\HtmlContentIndexBuilderProvider.cs Line: 108

Stack Trace:


[InvalidCastException: Unable to cast object of type 'mojoPortal.Business.CartanetContent' to type 'mojoPortal.Business.HtmlContent'.]
mojoPortal.Business.WebHelpers.HtmlContentIndexBuilderProvider.ContentChangedHandler(Object sender, ContentChangedEventArgs e) in C:\mojoportal\mojo\mojoPortal.Business.WebHelpers\IndexBuilders\HtmlContentIndexBuilderProvider.cs:108
mojoPortal.Business.CartanetContent.OnContentChanged(ContentChangedEventArgs e) in C:\mojoportal\mojo\mojoPortal.Business\CartanetContent.cs:367
mojoPortal.Business.CartanetContent.Update() in C:\mojoportal\mojo\mojoPortal.Business\CartanetContent.cs:255
mojoPortal.Business.CartanetContent.Save() in C:\mojoportal\mojo\mojoPortal.Business\CartanetContent.cs:278
mojoPortal.Web.ContentUI.CartanetEdit.btnUpdate_Click(Object sender, EventArgs e) in C:\mojoportal\mojo\Web\CartanetEdit.aspx.cs:224
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

 

Thank you

3/17/2008 7:53:42 AM
Gravatar
Total Posts 18439

Re: htmlmodule

You need to also clone the IndexBuilderProvider and modify it to expect your custom type. Then you must edit the code in the edit page to use your cloned provider (which will have a new name).

Be sure and use a new guid for the feature not the same one as the existing Html module.

Hope it helps,

Joe

3/17/2008 12:23:45 PM
Gravatar
Total Posts 13

Re: htmlmodule

Thank you Joe,

but is the guid the id of mp_moduledefinition table?

 

Thank you so much

3/17/2008 2:19:13 PM
Gravatar
Total Posts 18439

Re: htmlmodule

Yes, thats the guid I'm talking about. Make sure you create a new one, don't use the same one from the Html module. In ms sql you can create one with select newid() or in .NET code with Guid.NewGuid().ToString()

Hope it helps,

Joe

3/18/2008 9:05:46 AM
Gravatar
Total Posts 13

Re: htmlmodule

Hi Joe,

but when i added a new feature in the portal in the mp_moduledefinition table i can see a new record with the new ID and featurename. It's true?

Thank you

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