dummy beginer's question

Discussion in 'ASP .Net' started by Lloyd Dupont, Nov 20, 2005.

  1. Lloyd Dupont

    Lloyd Dupont Guest

    I'm creating a new web site with a master page.
    Imy master page is using a stylesheet
    Now the problem is: what if I don't want all page in the same directory but
    have some kind of hierarchy, like
    www.domain.net/webapp/home.aspx
    .....
    www.domain.net/webapp/forum/default.aspx
    and so on....

    The problem is, in my MaterPage I write:
    <link rel="stylesheet" type="text/css" href="cookweb.css" />

    but this is valid only in the 'wepbapp' folder.
    I though I could use '/cookweb.css' but while it will work on my webserver
    it won't work while I'm develping...
    How could I do that?!?
     
    Lloyd Dupont, Nov 20, 2005
    #1
    1. Advertising

  2. Lloyd Dupont

    clintonG Guest

    I think the most common way to resolve this is by using a base class all
    content pages inherit from. In the base class you use the ServerVariables
    collection to get path info and write that path info and css filename into
    an instance of the link element. THis can be done using the new Page.Header
    property [1].

    <%= Clinton Gallagher
    http://clintongallagher.metromilwaukee.com/

    [1] google: Page.Header site:msdn2.microsoft.com


    "Lloyd Dupont" <net.galador@ld> wrote in message
    news:...
    > I'm creating a new web site with a master page.
    > Imy master page is using a stylesheet
    > Now the problem is: what if I don't want all page in the same directory
    > but have some kind of hierarchy, like
    > www.domain.net/webapp/home.aspx
    > ....
    > www.domain.net/webapp/forum/default.aspx
    > and so on....
    >
    > The problem is, in my MaterPage I write:
    > <link rel="stylesheet" type="text/css" href="cookweb.css" />
    >
    > but this is valid only in the 'wepbapp' folder.
    > I though I could use '/cookweb.css' but while it will work on my webserver
    > it won't work while I'm develping...
    > How could I do that?!?
    >
     
    clintonG, Nov 20, 2005
    #2
    1. Advertising

  3. Lloyd Dupont

    Lloyd Dupont Guest

    hum, hum..
    I will think on that....

    "clintonG" <> wrote in message
    news:...
    >I think the most common way to resolve this is by using a base class all
    >content pages inherit from. In the base class you use the ServerVariables
    >collection to get path info and write that path info and css filename into
    >an instance of the link element. THis can be done using the new Page.Header
    >property [1].
    >
    > <%= Clinton Gallagher
    > http://clintongallagher.metromilwaukee.com/
    >
    > [1] google: Page.Header site:msdn2.microsoft.com
    >
    >
    > "Lloyd Dupont" <net.galador@ld> wrote in message
    > news:...
    >> I'm creating a new web site with a master page.
    >> Imy master page is using a stylesheet
    >> Now the problem is: what if I don't want all page in the same directory
    >> but have some kind of hierarchy, like
    >> www.domain.net/webapp/home.aspx
    >> ....
    >> www.domain.net/webapp/forum/default.aspx
    >> and so on....
    >>
    >> The problem is, in my MaterPage I write:
    >> <link rel="stylesheet" type="text/css" href="cookweb.css" />
    >>
    >> but this is valid only in the 'wepbapp' folder.
    >> I though I could use '/cookweb.css' but while it will work on my
    >> webserver it won't work while I'm develping...
    >> How could I do that?!?
    >>

    >
    >
     
    Lloyd Dupont, Nov 20, 2005
    #3
  4. Lloyd Dupont

    clintonG Guest

    This article [1] could prove helpful as will the MapPath property.

    <%= Clinton Gallagher

    [1] http://west-wind.com/weblog/posts/269.aspx


    "Lloyd Dupont" <net.galador@ld> wrote in message
    news:...
    > hum, hum..
    > I will think on that....
    >
    > "clintonG" <> wrote in message
    > news:...
    >>I think the most common way to resolve this is by using a base class all
    >>content pages inherit from. In the base class you use the ServerVariables
    >>collection to get path info and write that path info and css filename into
    >>an instance of the link element. THis can be done using the new
    >>Page.Header property [1].
    >>
    >> <%= Clinton Gallagher
    >> http://clintongallagher.metromilwaukee.com/
    >>
    >> [1] google: Page.Header site:msdn2.microsoft.com
    >>
    >>
    >> "Lloyd Dupont" <net.galador@ld> wrote in message
    >> news:...
    >>> I'm creating a new web site with a master page.
    >>> Imy master page is using a stylesheet
    >>> Now the problem is: what if I don't want all page in the same directory
    >>> but have some kind of hierarchy, like
    >>> www.domain.net/webapp/home.aspx
    >>> ....
    >>> www.domain.net/webapp/forum/default.aspx
    >>> and so on....
    >>>
    >>> The problem is, in my MaterPage I write:
    >>> <link rel="stylesheet" type="text/css" href="cookweb.css" />
    >>>
    >>> but this is valid only in the 'wepbapp' folder.
    >>> I though I could use '/cookweb.css' but while it will work on my
    >>> webserver it won't work while I'm develping...
    >>> How could I do that?!?
    >>>

    >>
    >>

    >
    >
     
    clintonG, Nov 21, 2005
    #4
  5. Lloyd Dupont

    clintonG Guest

    That should have been MapPath method [1] -- not -- property

    <%= Clinton Gallagher

    [1] mappath site:msdn2.microsoft.com

    "Lloyd Dupont" <net.galador@ld> wrote in message
    news:...
    > hum, hum..
    > I will think on that....
    >
    > "clintonG" <> wrote in message
    > news:...
    >>I think the most common way to resolve this is by using a base class all
    >>content pages inherit from. In the base class you use the ServerVariables
    >>collection to get path info and write that path info and css filename into
    >>an instance of the link element. THis can be done using the new
    >>Page.Header property [1].
    >>
    >> <%= Clinton Gallagher
    >> http://clintongallagher.metromilwaukee.com/
    >>
    >> [1] google: Page.Header site:msdn2.microsoft.com
    >>
    >>
    >> "Lloyd Dupont" <net.galador@ld> wrote in message
    >> news:...
    >>> I'm creating a new web site with a master page.
    >>> Imy master page is using a stylesheet
    >>> Now the problem is: what if I don't want all page in the same directory
    >>> but have some kind of hierarchy, like
    >>> www.domain.net/webapp/home.aspx
    >>> ....
    >>> www.domain.net/webapp/forum/default.aspx
    >>> and so on....
    >>>
    >>> The problem is, in my MaterPage I write:
    >>> <link rel="stylesheet" type="text/css" href="cookweb.css" />
    >>>
    >>> but this is valid only in the 'wepbapp' folder.
    >>> I though I could use '/cookweb.css' but while it will work on my
    >>> webserver it won't work while I'm develping...
    >>> How could I do that?!?
    >>>

    >>
    >>

    >
    >
     
    clintonG, Nov 21, 2005
    #5
  6. Lloyd Dupont

    Lloyd Dupont Guest

    I'll look at it! (when I'll get home).

    Anyway I used that:
    <link rel="stylesheet" type="text/css" href="~/cookweb.css" />
    the trick is the "~/" and the runat=server head section.
    And it works beautifully.


    "clintonG" <> wrote in message
    news:...
    > This article [1] could prove helpful as will the MapPath property.
    >
    > <%= Clinton Gallagher
    >
    > [1] http://west-wind.com/weblog/posts/269.aspx
    >
    >
    > "Lloyd Dupont" <net.galador@ld> wrote in message
    > news:...
    >> hum, hum..
    >> I will think on that....
    >>
    >> "clintonG" <> wrote in
    >> message news:...
    >>>I think the most common way to resolve this is by using a base class all
    >>>content pages inherit from. In the base class you use the ServerVariables
    >>>collection to get path info and write that path info and css filename
    >>>into an instance of the link element. THis can be done using the new
    >>>Page.Header property [1].
    >>>
    >>> <%= Clinton Gallagher
    >>> http://clintongallagher.metromilwaukee.com/
    >>>
    >>> [1] google: Page.Header site:msdn2.microsoft.com
    >>>
    >>>
    >>> "Lloyd Dupont" <net.galador@ld> wrote in message
    >>> news:...
    >>>> I'm creating a new web site with a master page.
    >>>> Imy master page is using a stylesheet
    >>>> Now the problem is: what if I don't want all page in the same directory
    >>>> but have some kind of hierarchy, like
    >>>> www.domain.net/webapp/home.aspx
    >>>> ....
    >>>> www.domain.net/webapp/forum/default.aspx
    >>>> and so on....
    >>>>
    >>>> The problem is, in my MaterPage I write:
    >>>> <link rel="stylesheet" type="text/css" href="cookweb.css" />
    >>>>
    >>>> but this is valid only in the 'wepbapp' folder.
    >>>> I though I could use '/cookweb.css' but while it will work on my
    >>>> webserver it won't work while I'm develping...
    >>>> How could I do that?!?
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Lloyd Dupont, Nov 21, 2005
    #6
  7. Lloyd Dupont

    clintonG Guest

    Good news. Some of my other suggestions were not even pertinent.

    <%= Clinton Gallagher

    "Lloyd Dupont" <net.galador@ld> wrote in message
    news:...
    > I'll look at it! (when I'll get home).
    >
    > Anyway I used that:
    > <link rel="stylesheet" type="text/css" href="~/cookweb.css" />
    > the trick is the "~/" and the runat=server head section.
    > And it works beautifully.
    >
    >
    > "clintonG" <> wrote in message
    > news:...
    >> This article [1] could prove helpful as will the MapPath property.
    >>
    >> <%= Clinton Gallagher
    >>
    >> [1] http://west-wind.com/weblog/posts/269.aspx
    >>
    >>
    >> "Lloyd Dupont" <net.galador@ld> wrote in message
    >> news:...
    >>> hum, hum..
    >>> I will think on that....
    >>>
    >>> "clintonG" <> wrote in
    >>> message news:...
    >>>>I think the most common way to resolve this is by using a base class all
    >>>>content pages inherit from. In the base class you use the
    >>>>ServerVariables collection to get path info and write that path info and
    >>>>css filename into an instance of the link element. THis can be done
    >>>>using the new Page.Header property [1].
    >>>>
    >>>> <%= Clinton Gallagher
    >>>> http://clintongallagher.metromilwaukee.com/
    >>>>
    >>>> [1] google: Page.Header site:msdn2.microsoft.com
    >>>>
    >>>>
    >>>> "Lloyd Dupont" <net.galador@ld> wrote in message
    >>>> news:...
    >>>>> I'm creating a new web site with a master page.
    >>>>> Imy master page is using a stylesheet
    >>>>> Now the problem is: what if I don't want all page in the same
    >>>>> directory but have some kind of hierarchy, like
    >>>>> www.domain.net/webapp/home.aspx
    >>>>> ....
    >>>>> www.domain.net/webapp/forum/default.aspx
    >>>>> and so on....
    >>>>>
    >>>>> The problem is, in my MaterPage I write:
    >>>>> <link rel="stylesheet" type="text/css" href="cookweb.css" />
    >>>>>
    >>>>> but this is valid only in the 'wepbapp' folder.
    >>>>> I though I could use '/cookweb.css' but while it will work on my
    >>>>> webserver it won't work while I'm develping...
    >>>>> How could I do that?!?
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    clintonG, Nov 21, 2005
    #7
    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. ArMa

    Beginer question

    ArMa, Apr 13, 2005, in forum: Java
    Replies:
    0
    Views:
    484
  2. R.A.M.
    Replies:
    1
    Views:
    12,928
    ValliM
    Jul 5, 2006
  3. Prem Mallappa

    beginer C question

    Prem Mallappa, Feb 5, 2004, in forum: C Programming
    Replies:
    6
    Views:
    479
    Mark McIntyre
    Feb 8, 2004
  4. Jim
    Replies:
    1
    Views:
    774
    bruno modulix
    Apr 14, 2005
  5. Echo
    Replies:
    1
    Views:
    293
    Larry Bates
    Mar 23, 2006
Loading...

Share This Page