Conversion of 1.x to 2.x

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.
7/29/2006 11:24:43 AM
Gravatar
Total Posts 73

Conversion of 1.x to 2.x

Hi all,

I'm trying to get a previous mojoPortal site to run under 2.1. I noticed that things have changed in a non/backwards/compatible way.

Can anybody tell me how to convert. My current ASPX files al have the code

protected

 

 

 

 

This has to change, but into what?

Any help is welcom.

 

Jan

mojoPortal.Web.ContentRegion MPTitle;protected mojoPortal.Web.ContentRegion MPLeftPane;protected mojoPortal.Web.ContentRegion MPContent;protected mojoPortal.Web.ContentRegion MPRightPane;protected mojoPortal.Web.MasterPage MPContainer;
7/29/2006 11:29:16 AM
Gravatar
Total Posts 73

Re: Conversion of 1.x to 2.x

protected mojoPortal.Web.ContentRegion MPTitle;
protected mojoPortal.Web.ContentRegion MPLeftPane;
protected mojoPortal.Web.ContentRegion MPContent;
protected mojoPortal.Web.ContentRegion MPRightPane;
protected mojoPortal.Web.MasterPage MPContainer;
7/29/2006 11:38:29 AM
Gravatar
Total Posts 18439

Re: Conversion of 1.x to 2.x

Hi Jan,

The change is from the Paul Wislon MasterPages in 1.1 framework to the official 2.0 .NET MasterPages.
The markup part of your .aspx pages has to be different in 2.0, see one of the other pages to understand.
You no longer need the declarations for those content regions. In 2.0 .NET the declarations are managed automatcially for you in .designer.cs files

old way:

<portal:MasterPage runat="server" id="MPContainer">
    <portal:ContentRegion id="MPTitle" runat="server"></portal:ContentRegion>
    <portal:ContentRegion id="MPLeftPane" runat="server"></portal:ContentRegion>
    <portal:ContentRegion id="MPContent" runat="server" Visible="True">
   
    Your content and controls here
   
    </portal:ContentRegion>
    <portal:ContentRegion id="MPRightPane" runat="server"></portal:ContentRegion>
</portal:MasterPage>

new way:

<asp:Content ContentPlaceHolderID="leftContent" ID="MPLeftPane" runat="server" />
<asp:Content ContentPlaceHolderID="mainContent" ID="MPContent" runat="server">

Your content and controls here

</asp:Content>
<asp:Content ContentPlaceHolderID="rightContent" ID="MPRightPane" runat="server" />
<asp:Content ContentPlaceHolderID="pageEditContent" ID="MPPageEdit" runat="server" />

Hope it helps,

Joe
7/29/2006 12:15:07 PM
Gravatar
Total Posts 73

Re: Conversion of 1.x to 2.x

Thanks Joe,

Do I need to change the ascx-modules as well?

Regards, Jan

7/29/2006 1:22:37 PM
Gravatar
Total Posts 18439

Re: Conversion of 1.x to 2.x

I don't think so. If you right click them there might be a conversion you can do that will automatically move the declarations and create the .designer.cs file for you. At least I recall that from when I did it. Its not essential to split them into partial classes but that is consistent with how new files will be created.

Joe
7/30/2006 10:54:38 AM
Gravatar
Total Posts 73

Re: Conversion of 1.x to 2.x

It was a bit more complex then what you suggested. I had to replace code in the aspx.cs too.

And add a reference to the master layout in the aspx itself.

Everything compiles well now, but when I try to start a page, all I see is an empty page. Is there an aspx file present I could take as an example?

One other thing I noticed is that color settings and font settings of e.g. tables I apply in VS2005 are neglected when the ascx is shown. Where can I change this? Probably in the css file at theme level?

Regards,

 

Jan

7/30/2006 12:25:23 PM
Gravatar
Total Posts 73

Re: Conversion of 1.x to 2.x

I managed to show the content. The layout is horrible. I designed it previously in VS2003. The contenct I create seems to be displayes in a very small area (MPContent). Can I change this behaviour. How can I do that?

Regards,

Jan

7/30/2006 12:40:56 PM
Gravatar
Total Posts 18439

Re: Conversion of 1.x to 2.x

Hi Jan,

Yes I didn't mean to imply that markup was all there is to it, but looking at any site page for example, LinksEdit.aspx, look in the  markup and in the code behind for things you might need.

For example your page should inherit from mojoBasePage. I generally set AutoEventWireup=false in the .aspx file and hookup my own events in OnInit but you don't have to do it that way.

You can put content into any of the content regions.

Hope it helps,

Joe
7/31/2006 11:19:01 AM
Gravatar
Total Posts 73

Re: Conversion of 1.x to 2.x

Hi Joe,

In the old version of MoJo, I was possible to add a table to a page and give that table some header characteristics (color, paging etc). All this was presented the way it was shown in the designer of Visual Studio. The designer shows the tables but when an ascx or aspx is started from MoJo, all formatting seems to be gone / overwritten.

I adopted parts of your mojo aspx and ascx modules, but it stayes the same.

Regards,

Jan

7/31/2006 11:29:02 AM
Gravatar
Total Posts 18439

Re: Conversion of 1.x to 2.x

Hi Jan,

when you say table do you mean raw html table or DataGrid or some kind of server controls?
Raw html table should style according to your properties or CSS settings.
Server controls like DataGrid will take their style from the theme.skin file unless you put a setting on it like SkinID="plain". Since there is no skin named "plain" it effectively will disconnect it from the theme.skin file.
Or you can set properties on the theme.skin file in your skin folder to style the server controls.

I'm not sure of a good way to make it use the same theme at design time as it does at runtime. At design time it might be using the App_Themes/Default/theme.skin but at runtime it should use the one in your skin folder.
I hardly ever use the designer so I'm not as up on these things as I should be. If you customize your theme.skin file you might try and copy it into App_themes/Default and see if that makes it look right at design time.

Hope it helps,

Joe
7/31/2006 12:54:00 PM
Gravatar
Total Posts 73

Re: Conversion of 1.x to 2.x

Changing things in the skin file seem to work for ascx. Still having problems with aspx.

Is there some proper skin editor? I like to do things in a visual controlable way. I.e. a skin designer?

Thnx,

Jan

 

 

7/31/2006 2:21:49 PM
Gravatar
Total Posts 18439

Re: Conversion of 1.x to 2.x

mojoPortal skins are made up of layout.Master, style.css, and theme.skin files and supporting images

layout.master I think can be used in the VS designer, .skin and .css don't have designers, just editors.
If you copy your skin files into App_Themes/Default and then put

Theme="default" in the Page Declaration
<%@ Page language="c#" Codebehind="PageSettings.aspx.cs" Theme="default" MasterPageFile="~/Controls/layout.Master" AutoEventWireup="false" Inherits="mojoPortal.Web.PageProperties" %>

It might work better in the designer.

Hope it helps,

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