HOWTO: Include Style Sheet Links in the ASCX Controls?

Discussion in 'ASP .Net' started by Don Wash, Aug 30, 2004.

  1. Don Wash

    Don Wash Guest

    Hi There!

    I'm creating several ASCX Controls and those controls will have their own
    CSS Style Sheets. But I don't know how I can link the corresponding Style
    Sheet in the ASCX file? Because the style sheet can only be linked in the
    <head></head> section of an HTML document, right? So ASCX controls does not
    have <head> tags so how can I link the style sheets?

    Many thanks in advance!
    Don
     
    Don Wash, Aug 30, 2004
    #1
    1. Advertising

  2. Don Wash

    Hermit Dave Guest

    set the cssclass to whatever you need it to be... since user control will
    always be a part of a page. as long as the page has the stylesheet directive
    it will apply the stylesheet to the user control. (css stylesheets are
    client site... )

    --

    Regards,

    Hermit Dave
    (http://hdave.blogspot.com)
    "Don Wash" <> wrote in message
    news:...
    > Hi There!
    >
    > I'm creating several ASCX Controls and those controls will have their own
    > CSS Style Sheets. But I don't know how I can link the corresponding Style
    > Sheet in the ASCX file? Because the style sheet can only be linked in the
    > <head></head> section of an HTML document, right? So ASCX controls does

    not
    > have <head> tags so how can I link the style sheets?
    >
    > Many thanks in advance!
    > Don
    >
    >
     
    Hermit Dave, Aug 30, 2004
    #2
    1. Advertising

  3. Don Wash

    Don Wash Guest

    Hi Hermit,

    Thanks for the reply.

    But then, I have to remember to include the corresponding style of each
    control in every page that consumes. How do I workaround this?

    Thanks again!
    Don

    "Hermit Dave" <> wrote in message
    news:...
    > set the cssclass to whatever you need it to be... since user control will
    > always be a part of a page. as long as the page has the stylesheet
    > directive
    > it will apply the stylesheet to the user control. (css stylesheets are
    > client site... )
    >
    > --
    >
    > Regards,
    >
    > Hermit Dave
    > (http://hdave.blogspot.com)
    > "Don Wash" <> wrote in message
    > news:...
    >> Hi There!
    >>
    >> I'm creating several ASCX Controls and those controls will have their own
    >> CSS Style Sheets. But I don't know how I can link the corresponding Style
    >> Sheet in the ASCX file? Because the style sheet can only be linked in the
    >> <head></head> section of an HTML document, right? So ASCX controls does

    > not
    >> have <head> tags so how can I link the style sheets?
    >>
    >> Many thanks in advance!
    >> Don
    >>
    >>

    >
    >
     
    Don Wash, Aug 31, 2004
    #3
  4. Don Wash

    Don Wash Guest

    ....

    "Don Wash" <> wrote in message
    news:...
    > Hi There!
    >
    > I'm creating several ASCX Controls and those controls will have their own
    > CSS Style Sheets. But I don't know how I can link the corresponding Style
    > Sheet in the ASCX file? Because the style sheet can only be linked in the
    > <head></head> section of an HTML document, right? So ASCX controls does
    > not
    > have <head> tags so how can I link the style sheets?
    >
    > Many thanks in advance!
    > Don
    >
    >
     
    Don Wash, Aug 31, 2004
    #4
  5. Don Wash

    Hermit Dave Guest

    i only have one global style sheet which all my aspx pages use. it has all
    the classes and element based style
    all you do is include it in your aspx pages and as long as controls set the
    cssclasses you should be fine.

    --

    Regards,

    Hermit Dave
    (http://hdave.blogspot.com)
    "Don Wash" <> wrote in message
    news:O$...
    > Hi Hermit,
    >
    > Thanks for the reply.
    >
    > But then, I have to remember to include the corresponding style of each
    > control in every page that consumes. How do I workaround this?
    >
    > Thanks again!
    > Don
    >
    > "Hermit Dave" <> wrote in message
    > news:...
    > > set the cssclass to whatever you need it to be... since user control

    will
    > > always be a part of a page. as long as the page has the stylesheet
    > > directive
    > > it will apply the stylesheet to the user control. (css stylesheets are
    > > client site... )
    > >
    > > --
    > >
    > > Regards,
    > >
    > > Hermit Dave
    > > (http://hdave.blogspot.com)
    > > "Don Wash" <> wrote in message
    > > news:...
    > >> Hi There!
    > >>
    > >> I'm creating several ASCX Controls and those controls will have their

    own
    > >> CSS Style Sheets. But I don't know how I can link the corresponding

    Style
    > >> Sheet in the ASCX file? Because the style sheet can only be linked in

    the
    > >> <head></head> section of an HTML document, right? So ASCX controls does

    > > not
    > >> have <head> tags so how can I link the style sheets?
    > >>
    > >> Many thanks in advance!
    > >> Don
    > >>
    > >>

    > >
    > >

    >
    >
     
    Hermit Dave, Aug 31, 2004
    #5
  6. Don Wash

    Don Wash Guest

    ....

    "Don Wash" <> wrote in message
    news:...
    > Hi There!
    >
    > I'm creating several ASCX Controls and those controls will have their own
    > CSS Style Sheets. But I don't know how I can link the corresponding Style
    > Sheet in the ASCX file? Because the style sheet can only be linked in the
    > <head></head> section of an HTML document, right? So ASCX controls does
    > not
    > have <head> tags so how can I link the style sheets?
    >
    > Many thanks in advance!
    > Don
    >
    >
     
    Don Wash, Aug 31, 2004
    #6
  7. Don Wash

    Don Wash Guest

    ....

    "Don Wash" <> wrote in message
    news:...
    > Hi There!
    >
    > I'm creating several ASCX Controls and those controls will have their own
    > CSS Style Sheets. But I don't know how I can link the corresponding Style
    > Sheet in the ASCX file? Because the style sheet can only be linked in the
    > <head></head> section of an HTML document, right? So ASCX controls does
    > not
    > have <head> tags so how can I link the style sheets?
    >
    > Many thanks in advance!
    > Don
    >
    >
     
    Don Wash, Aug 31, 2004
    #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. Quentin
    Replies:
    1
    Views:
    498
    Quentin
    Jul 29, 2003
  2. Jason Shohet
    Replies:
    1
    Views:
    488
    Kevin Spencer
    Nov 10, 2003
  3. Holger (David) Wagner
    Replies:
    2
    Views:
    1,956
    Holger (David) Wagner
    Jul 3, 2004
  4. Replies:
    0
    Views:
    532
  5. Andreas Bogenberger
    Replies:
    3
    Views:
    960
    Andreas Bogenberger
    Feb 22, 2008
Loading...

Share This Page