CSS Styles

S

slawek xxxxx

Hello everyone,

I have following problem : I develop asp.Net Application using web
controls. In each control I have a link to css stylesheet. If I use my
controls in pages located in two different directories (eg.
\adminpages\xxx.aspx and \adminpages\sysoperator\yyy.aspx) my controls
can't locate stylesheets. Is there any way to use a reference (in link
object) directly to main directory of the application?? Now I have :
<LINK href="CommonControls/Css/MyControl.css" type="text/css"
rel="stylesheet"> and I want to change it to something like :<LINK
href="{root}/CommonControls/Css/MyControl.css" type="text/css"
rel="stylesheet">, but I dont know how to obtain {root} path, supposing
that it's possible. Any suggetions??
Thanks in advance
Slawek
 
C

CMA

as to your explanation, your files r loxcated like this...


--root
|--adminpages
| |--xxx.aspx
| |--styles.css
|
|--sysoperator/yyy.aspx

u have to copy the css in ur application root folder, that is "adminpages"
for now. (like in the above figure. i think u have this for now)
in xxx.aspx u can use...
<LINK href="styles.css" type="text/css">

in sysoperator/yyy.aspx u can use...
<LINK href="../styles.css" type="text/css">

where "../" says get the file from the previous folder.

OR you can keep css file in a seperate directory under "adminfiles" and set
the path to match it.

hope this helps,

CMA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,075
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top