We have implemented themes in our web application by using attached files
and <link href="CSS.Aspx" rel="stylesheet" type="text/css" />
we stores themes in db and have used <% %> in CSS.Aspx
depending upon the user themes settings is fetched from DB and appropriate variables are assigned values to the variables like 'TextBoxColor' in attached files.
everything works fine.
Now I need to export this dynamic css file or in simple words i need to save this CSS.Aspx on server side after <% %> is replaced by its value (file similar to attached RenderedCSS.css ) so that i can zip it and return to the user
I have used attached code but problem with this code is that it gives me CSS.Aspx file with <% %> but i want file similar to RenderedCSS.css
also i'm using .net 2.0 framework
P.S. Don't suggest me to change my approach of dynamic CSS(CSS.Aspx) with App_Themes approach because its not possible to change this in our project.
String inputFile = MapPath("../css/css.aspx");
String sDiskFile = "../temp/result.css";
WebRequest webRequest = WebRequest.Create(inputFile);
WebResponse webResponse = webRequest.GetResponse();
Stream stream = webResponse.GetResponseStream();
StreamReader oReader = new StreamReader(stream);
StreamWriter oWriter = new StreamWriter(Server.MapPath(sDiskFile));