Mule Skinner

VBAHole22

Contributor
Joined
Oct 21, 2003
Messages
432
Location
VA
I have a generic web application that I use to service about 5 different clients. They all see a basic login page and after they logon they get information specific to their company. They all get the same pages just filtered for them.

What I would like to do is 'skin' the app for each of these clients so that they feel like they have their own application because it has their logos and colors.

The main page has 3 datagrids on it and a treeview. I would like to color those as well as the background header bars and footer space. In addition I have logos for each but they are different sizes.

Right now I have one color scheme and I have tried my best to get all of it in css, although with the datagrid I found I couldn't do that as much as I would have liked so some is hard-coded in the html.

How do you make a skinned app like this? Anyone know of any good references? Do I modify the css at runtime? Do I maintain different css files and swap them in? What about the hard-coded html styles on the grids? Can this styling be done in code behind? If so then do I write different modules for each site with the color information?

Any suggestions greatly appreciated.


"I can make any mule listen..."
 
I worked on such app at my last job. Now, if I remember correctly (it's been 2 yrs), the app stored the color,size, logo stuff in the database. I think each client had an ID, app read the ID, got the info related to that client...

I think we had CSS and image paths everything in the database. It was ASP app. We had one generic look to the app but then changed it based on the client. The key was that everything was stored in the database...

Styling, for example, background color of Datagrid can be done in the code behind. In my current app, for example, I change the datagrid based on some specific data...
 
This is sort of the approach I am attempting. Rather than trying to store all of the colors and settings in the database I was just going to keep them all in separate css sheets and then the link to the sheet in the db.

I found some code on this site in the tutor area that inherits from the page class and 'builds' the page piece by piece as it is rendered.

Well I borrowed a small piece of that code and I am adding the css link as a literal control once I determine the path to the css based on the user login. I then emit it into the page like so:

Code:
Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
        'Grab the project variable set at login
        Project = Session("Project")
        Dim sheet As String

        If Project = "arren" Then
            sheet = "../css/arren_Styles.css"
        Else
            sheet = "../css/Styles.css"
        End If

        Dim css As System.Web.UI.LiteralControl = New System.Web.UI.LiteralControl(sheet)
        AddToBase("<link type=""text/css"" rel=""stylesheet"" href=""")
        Me.Controls.Add(css)
        AddToBase(""" />" & ControlChars.NewLine)
    End Sub
    Private Sub AddToBase(ByVal output As String)
        'Adds literal controls to the page
        Me.Controls.Add(New LiteralControl(output))
    End Sub

The trouble is that this css link is only picked up after a refresh, not the original load of the page. I seem to recall reading about this issue somewhere but I can't recall where and how they got around it.

I know this stuff gets easier in asp.net 2.0 but we ain't gonna be there for a while so I need to figure out a solution for the time being.

Any suggestions?
 
Wish I could just step up to 2.0 and use the new themes. But how are folks getting to 2.0? All I see is downloads for express editions. Can I install one of those alongside VS2003?
Would I just need the web express edition? When will the full VS studio version be available?
 
I'd say do some searches on google, you never know, you might find your answer there..

.Net 247 is also a good site, do a search there as well
 
Back
Top