Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Stylesheet via DB
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Stylesheet via DB

 Post Reply Post Reply Page  12>
Author
Amateur View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 July 2004
Location: Ireland
Status: Offline
Points: 210
Post Options Post Options   Thanks (0) Thanks(0)   Quote Amateur Quote  Post ReplyReply Direct Link To This Post Topic: Stylesheet via DB
    Posted: 06 December 2004 at 5:37am
Could anyone enlighten me how I could set up a cascading stylesheet to read its values (text size etc) from an Access Database?
Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 06 December 2004 at 8:19am
If you have the CSS file internal to a page, then you can replace the values with <%=var%> tags after the database call.

If you use external stylesheets, you need to configure the webserver to execute ASP on .css file extensions.
Back to Top
Amateur View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 July 2004
Location: Ireland
Status: Offline
Points: 210
Post Options Post Options   Thanks (0) Thanks(0)   Quote Amateur Quote  Post ReplyReply Direct Link To This Post Posted: 06 December 2004 at 8:46am
Originally posted by Gullanian Gullanian wrote:


If you use external stylesheets, you need to configure the webserver to execute ASP on .css file extensions.
 
It will be an external stylesheet. How do I configure the webserver to execute ASP/ASP.NET on .css file extensions?
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 06 December 2004 at 8:53am
I would not do that, just create a standard asp/aspx file, read your values from the db and change the response output type to text/css, thus if you are using .net this is not really necessary as it just creates additional overhead.
Back to Top
Bluefrog View Drop Down
Senior Member
Senior Member


Joined: 23 October 2002
Location: Korea, South
Status: Offline
Points: 1701
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bluefrog Quote  Post ReplyReply Direct Link To This Post Posted: 06 December 2004 at 8:54am
I put a long post on this somewhere in the forums a long time ago - try a search. You simply need to go into IIS and configure it to accept files with a CSS extension to be processed through the asp.dll under the WINDOWS directory (look in a sub dir). Make sure to configure the verbs the same as ASP (ASP.NET).

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 06 December 2004 at 9:17am
Actually, a style sheet does not have to end in css. I use asp style sheets all the time, Check out http://www.new2asp.com/Template.asp
 
If you View Source, you'll see the style sheet invoked with
<link rel="stylesheet" type="text/css" href="/css/new2asp_css.asp?TestFlag=y">
 
There a link in the top-right box to view the asp style sheet used.
Note that the .asp stylesheet begins with
<%Response.ContentType="text/css"%>
 
For the rest of it, it's just like then you intermingle asp and html code.
In this example, I use code at the bottom of the style sheet to put in code to override styles for testing purposes. Could just as easily had something like this within the css code
h1 { font-size:<%=somevariable%>;font-family:<%some asp code%>;}


Edited by dpyers - 06 December 2004 at 9:18am

Lead me not into temptation... I know the short cut, follow me.
Back to Top
Bluefrog View Drop Down
Senior Member
Senior Member


Joined: 23 October 2002
Location: Korea, South
Status: Offline
Points: 1701
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bluefrog Quote  Post ReplyReply Direct Link To This Post Posted: 06 December 2004 at 9:40am
Originally posted by dpyers dpyers wrote:

Actually, a style sheet does not have to end in css. I use asp style sheets all the time, Check out http://www.new2asp.com/Template.asp
 
If you View Source, you'll see the style sheet invoked with
<link rel="stylesheet" type="text/css"
href="/css/new2asp_css.asp?TestFlag=y">
 
There a link in the top-right box to view the asp style sheet used.
Note that the .asp stylesheet begins with
<%Response.ContentType="text/css"%>
 
For the rest of it, it's just like then you intermingle asp and html code.
In this example, I use code at the bottom of the style sheet to put in code to override styles for testing purposes. Could just as easily had something like this within the css code
h1 { font-size:<%=somevariable%>;font-family:<%some asp code%>;}


Very true, and a much more versatile solution, as well as being cheaper on the CPU.


Back to Top
Amateur View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 July 2004
Location: Ireland
Status: Offline
Points: 210
Post Options Post Options   Thanks (0) Thanks(0)   Quote Amateur Quote  Post ReplyReply Direct Link To This Post Posted: 06 December 2004 at 10:26am
Originally posted by dpyers dpyers wrote:

Actually, a style sheet does not have to end in css. I use asp style sheets all the time, Check out http://www.new2asp.com/Template.asp
 
If you View Source, you'll see the style sheet invoked with
<link rel="stylesheet" type="text/css" href="/css/new2asp_css.asp?TestFlag=y">
 
There a link in the top-right box to view the asp style sheet used.
Note that the .asp stylesheet begins with
<%Response.ContentType="text/css"%>
 
For the rest of it, it's just like then you intermingle asp and html code.
In this example, I use code at the bottom of the style sheet to put in code to override styles for testing purposes. Could just as easily had something like this within the css code
h1 { font-size:<%=somevariable%>;font-family:<%some asp code%>;}
 
Thanks for this, really helps me. Going to play around with this for a while and see what i can do with it in ASP.NET. Presume that I can connect to a db in the new2asp_css.asp so will go from there.
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.