I am building a product that we are eventually going to white-label. Right now I am trying to figure out the best way to facilitate these requirements programmatically so th
I like the idea of using dynamic CSS using an ASP.Net Handler...
style.ashx
StyleSheetHandler.cs
public class StyleSheetHandler : IHttpHandler {
public void ProcessRequest (HttpContext context)
{
context.Response.ContentType = "text/css";
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
string css = BuildCSSString(); //not showing this function
context.Response.Cache.SetExpires(DateTime.Now.AddSeconds(600));
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.Write( css );
}
public bool IsReusable
{
get { return true; }
}
}
The BuildCSSString() Function will build the css based on the values stored in the database and return it to override the base style on the master page.