css stylesheets

Discussion in 'ASP .Net Building Controls' started by slawek xxxxx, Feb 9, 2004.

  1. slawek xxxxx

    slawek xxxxx Guest

    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



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    slawek xxxxx, Feb 9, 2004
    #1
    1. Advertising

  2. 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

    "slawek xxxxx" <> wrote in message
    news:...
    > 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
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Michael Morse, Feb 11, 2004
    #2
    1. Advertising

  3. slawek xxxxx

    slawek xxxxx Guest

    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





    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    slawek xxxxx, Feb 16, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rod  Snyder
    Replies:
    3
    Views:
    2,609
    =?Utf-8?B?RGF2aWQgQ29l?=
    Feb 2, 2004
  2. George

    Css Stylesheets and aspx

    George, Aug 24, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    26,699
    George
    Aug 24, 2004
  3. Hans Kesting
    Replies:
    0
    Views:
    346
    Hans Kesting
    Feb 8, 2005
  4. Dave Higgins
    Replies:
    12
    Views:
    1,018
    Nick Howes
    Nov 22, 2003
  5. Laura

    CSS Stylesheets question

    Laura, Apr 10, 2006, in forum: HTML
    Replies:
    2
    Views:
    345
    Colin Wilson
    Apr 13, 2006
Loading...

Share This Page