References Style Sheets from a sub directory

  • Thread starter Thread starter Philip Poole
  • Start date Start date
P

Philip Poole

Hello everyone,

I hope you can help me, I have trawled the newgroups for an answer for this
and could not find one.

I have set up a template aspx page which consists of a number of user
controls, the template page contains a style sheet which all controls use.
However when I stick the template aspx into a subdirectory, it looses the
links to the style sheet.

Question 1) Apart from manually changing the link can I get ASP.net to find
the path autmotically, I have tried adding runat="server" to the LINK tag
but asp does not like it.

Next point: The css style sheet contains links to images, so even if i
change the relative path of the style sheet manually it cannot find the
images (as it is expecting to find them in a image directory within the
subfolder) .

Question 2) Is there any way to put relevtive paths in the style sheet so
that asp.net can change to the correct location, i..e "~/images/image.jpg".

Kind Regards

Philip
 
Hi,

1) You will have to edit the path manually for each file.
2) The paths to the images in a css file should be relative to the location
of the css file itself, not to the location of the page that links to the
css file.

Hope this helps
Martin
 
Hi Martin,

Thankyou for your help.

I had confused some images which were embeded in the asp file with images in
the css making me think that the paths in the css were not workingo I now
have this issued sorted.

Does you or anyone else know if you can code the path to the CSS file as a
relative path? It would be nice to have a template which I do not have to
change (even one line).

Thankyou for your help

Philip
 
Back
Top