css stylesheets

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
 
M

Michael Morse

If you start your href path with a '/' that specifies to start at the root
so

href="/CommonControls/Css/MyControl.css" means
starting at root go to CommonControls then Css and grab file MyControl.css

hope this helps.

-mike
 
S

slawek xxxxx

Thanks a lot, but when I wrote <root> I mean my application root path,
not "wwwroot". In this case (using "\") if application folder will have
different name then all links will be no more valid. Mayby there is
another way to obtain root paths related to the main application
folder??

Thanks a lot for help
Slawek
 

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
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top