Change the Skin Programmatically

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.
9/8/2010 1:41:36 AM
Gravatar
Total Posts 26

Change the Skin Programmatically

hi Joe,

    How to i apply the new skin,when i am redirecting to one page to another page Programmatically.

9/8/2010 3:45:42 AM
Gravatar
Total Posts 8

Re: Change the Skin Programmatically

Hi,

 

Have you tried this?

siteSettings.Skin = "SkinName";

That I guessing will change the skin for the whole site and all users but I guess there are a similar settings for a single user..

 

Setting 

this.SkinID  

in page load might do it as well.. and just for that page and session.

 

//Stefan

9/8/2010 6:38:38 AM
Gravatar
Total Posts 18439

Re: Change the Skin Programmatically

mojoPortal currently supports using different skins for different pages and also it supports letting the user choose their own skin. Both of these options are disabled by default but can be enabled from Administration > Site Settings

So if you just want to use different skins on different pages you don't need to do it programmatically.

Hope it helps,

Joe

10/22/2010 5:32:45 PM
Gravatar
Total Posts 245
mojoPortal Community Expert

Re: Change the Skin Programmatically

In my own feature.

I have allowed pages to have alternate skins via sitesettings and this works great.  My alternate skin is the same artisteer skin but with no header picture.  This allows me more screen real estate on my pages.

However, I would like to use this alternate skin for my add/edit page called by those pages also.

When I add this in LoadSettings()

 

this.siteSettings.SiteName = "";
this.siteSettings.Slogan = "";
this.siteSettings.SkinBaseUrl = "my alternate skin";

to the add/edit page this works but it is permanent to the whole site from that moment forward.

Can I pragmatically add code to my add/edit pages so they use the calling page alternate skin also?

Thanks

Rick
10/22/2010 6:23:24 PM
Gravatar
Total Posts 245
mojoPortal Community Expert

Re: Change the Skin Programmatically

SOLVED!

I fixed my problem by reversing my skins and editing the layout.master as follows.

I made the no-header skin the default site skin.

I made the with-header skin the alternate skin for the home page.

Then in the no-header layout.master, I removed the title and slogan div's

I just earned myself a beer so have to go now.

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