Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Cross Browser Skin/Containers - attaching multiple stylesheetsCross Browser Skin/Containers - attaching multiple stylesheets
Previous
 
Next
New Post
4/1/2008 1:52 AM
 

Hi Andy,

(For some reason the notification does not work for me so I apologize for not responding earlier )

This is a brilliant solution to a problem I am sure every skin developer deal with. Thank you for sharing this, I'll try it and hope to get it to work.

Thank you,

Yehuda

 


Yehuda Tiram
AtarimTR
AtarimTR
972-2-5700114   |   972-54-4525492   |    http://www.atarimtr.co.il
 
New Post
4/4/2008 3:09 PM
 

Great idea! Works like a charm. Thanks for sharing it.

 

James

 
New Post
6/17/2008 11:08 AM
 

Thank you very much for this post.  I just have a question because I am still a novice at asp.net.

I was wondering how to make a codebehind file inherit the DotNetNuke.UI.Skins.Skin.  I know how to make the ascx use a different codebehind file.

If my skin is blue.ascx and my code behind file was css.cs then the top line would be as follows I would think.

<%@ Control language="c#" CodeBehind="css.cs" AutoEventWireup="false" Explicit="True" Inherits="css" %>

And this is my css.cs file

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
/// <summary>
/// This is used for conditional comments for CSS
/// </summary>
public partial class css : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string cssFixFile = null;
        // Note, "Firefox", "Opera", "Netscape" can all be detected using this method.   
        if (Request.Browser.Browser.Equals("IE"))  
        {     
            // IE detected     
            //     
            if (Request.Browser.MajorVersion == 7)     
            {        
                // IE7 detected - create a full path to the skin_IE7.css file        
                cssFixFile = Path.Combine(this.SkinPath, "skin_IE7.css");     
            }     
            else if (Request.Browser.MajorVersion == 6)     
            {        
                // IE6 detected - create a full path to the skin_IE6.css file        
                cssFixFile = Path.Combine(this.SkinPath, "skin_IE6.css");     
            }     
            else if (Request.Browser.MajorVersion == 5 && Request.Browser.MinorVersion == 5)     
            {        
                // IE5.5 Detected - create a full path to the skin_IE5_5.css file        
                cssFixFile = Path.Combine(this.SkinPath, "skin_IE5_5.css");     
            }     
            else if (Request.Browser.MajorVersion <= 5)     
            {        
                // IE5 or less detected - create a full path to the skin_IE5.css file        
                cssFixFile = Path.Combine(this.SkinPath, "skin_IE5.css");     
            }     
            // etc... more browser detection possible  
        }  
        // Load in the CSS file for the browser  
        if (cssFixFile != null)  
        {     
            // If a CSS file is needed, this part loads it in     
            HtmlGenericControl link = new HtmlGenericControl("LINK");     
            link.Attributes.Add("rel","stylesheet");     
            link.Attributes.Add("type","text/css");     
            link.Attributes.Add("href", cssFixFile );     
            Controls.Add(link);  
        }
    }
}

I am not sure I need all those namespaces, but I figured this would be the best place to ask.  Also I am not sure where to put the inheritance of DotNetNuke.UI.Skins.Skin in my css.cs file. 

I am sorry I am asking dumb questions.  Like I said, I am still a novice at asp.net and have written only a few web apps in C# using asp.net. 

Thanks and I am sorry to bug you.

~Morty

 
New Post
6/22/2008 12:55 AM
 

This is marked as resolved, but I stil have not had my above question answered.  I am still a bit confused on wether or not I am doing the right thing.

Thanks and sorry to be a bug.

~Morty

 
New Post
8/19/2010 7:24 AM
 
1. Use an XHTML doctype for your skin.
2. You can use the code below or this skin object: http://dnnskinextensions.codeplex.com...

Also: develop for Firefox and add hacks for IE 7 or 6.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Cross Browser Skin/Containers - attaching multiple stylesheetsCross Browser Skin/Containers - attaching multiple stylesheets


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out