browse: forums | FAQ
Connecting Tech Pros Worldwide

Hey there! Do you need ASP.NET help?

Get answers from our community of ASP.NET experts on BYTES! It's free.

HOWTO: Include Style Sheet Links in the ASCX Controls?

Don Wash
Guest
 
Posts: n/a
#1: Nov 18 '05
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
Guest
 
Posts: n/a
#2: Nov 18 '05

re: HOWTO: Include Style Sheet Links in the ASCX Controls?


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" <don@wash.com> wrote in message
news:eLioPMpjEHA.140@TK2MSFTNGP12.phx.gbl...[color=blue]
> 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[/color]
not[color=blue]
> have <head> tags so how can I link the style sheets?
>
> Many thanks in advance!
> Don
>
>[/color]


Don Wash
Guest
 
Posts: n/a
#3: Nov 18 '05

re: HOWTO: Include Style Sheet Links in the ASCX Controls?


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" <hermitd.REMOVE@CAPS.AND.DOTS.hotmail.com> wrote in message
news:esQFbXpjEHA.3896@TK2MSFTNGP15.phx.gbl...[color=blue]
> 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" <don@wash.com> wrote in message
> news:eLioPMpjEHA.140@TK2MSFTNGP12.phx.gbl...[color=green]
>> 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[/color]
> not[color=green]
>> have <head> tags so how can I link the style sheets?
>>
>> Many thanks in advance!
>> Don
>>
>>[/color]
>
>[/color]


Don Wash
Guest
 
Posts: n/a
#4: Nov 18 '05

re: HOWTO: Include Style Sheet Links in the ASCX Controls?


....

"Don Wash" <don@wash.com> wrote in message
news:eLioPMpjEHA.140@TK2MSFTNGP12.phx.gbl...[color=blue]
> 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
>
>[/color]


Hermit Dave
Guest
 
Posts: n/a
#5: Nov 18 '05

re: HOWTO: Include Style Sheet Links in the ASCX Controls?


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" <don@wash.com> wrote in message
news:O$eUMZxjEHA.3392@TK2MSFTNGP15.phx.gbl...[color=blue]
> 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" <hermitd.REMOVE@CAPS.AND.DOTS.hotmail.com> wrote in message
> news:esQFbXpjEHA.3896@TK2MSFTNGP15.phx.gbl...[color=green]
> > set the cssclass to whatever you need it to be... since user control[/color][/color]
will[color=blue][color=green]
> > 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" <don@wash.com> wrote in message
> > news:eLioPMpjEHA.140@TK2MSFTNGP12.phx.gbl...[color=darkred]
> >> Hi There!
> >>
> >> I'm creating several ASCX Controls and those controls will have their[/color][/color][/color]
own[color=blue][color=green][color=darkred]
> >> CSS Style Sheets. But I don't know how I can link the corresponding[/color][/color][/color]
Style[color=blue][color=green][color=darkred]
> >> Sheet in the ASCX file? Because the style sheet can only be linked in[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> >> <head></head> section of an HTML document, right? So ASCX controls does[/color]
> > not[color=darkred]
> >> have <head> tags so how can I link the style sheets?
> >>
> >> Many thanks in advance!
> >> Don
> >>
> >>[/color]
> >
> >[/color]
>
>[/color]


Hermit Dave
Guest
 
Posts: n/a
#6: Nov 18 '05

re: HOWTO: Include Style Sheet Links in the ASCX Controls?


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" <don@wash.com> wrote in message
news:O$eUMZxjEHA.3392@TK2MSFTNGP15.phx.gbl...[color=blue]
> 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" <hermitd.REMOVE@CAPS.AND.DOTS.hotmail.com> wrote in message
> news:esQFbXpjEHA.3896@TK2MSFTNGP15.phx.gbl...[color=green]
> > set the cssclass to whatever you need it to be... since user control[/color][/color]
will[color=blue][color=green]
> > 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" <don@wash.com> wrote in message
> > news:eLioPMpjEHA.140@TK2MSFTNGP12.phx.gbl...[color=darkred]
> >> Hi There!
> >>
> >> I'm creating several ASCX Controls and those controls will have their[/color][/color][/color]
own[color=blue][color=green][color=darkred]
> >> CSS Style Sheets. But I don't know how I can link the corresponding[/color][/color][/color]
Style[color=blue][color=green][color=darkred]
> >> Sheet in the ASCX file? Because the style sheet can only be linked in[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> >> <head></head> section of an HTML document, right? So ASCX controls does[/color]
> > not[color=darkred]
> >> have <head> tags so how can I link the style sheets?
> >>
> >> Many thanks in advance!
> >> Don
> >>
> >>[/color]
> >
> >[/color]
>
>[/color]


Don Wash
Guest
 
Posts: n/a
#7: Nov 18 '05

re: HOWTO: Include Style Sheet Links in the ASCX Controls?


....

"Don Wash" <don@wash.com> wrote in message
news:eLioPMpjEHA.140@TK2MSFTNGP12.phx.gbl...[color=blue]
> 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
>
>[/color]


Don Wash
Guest
 
Posts: n/a
#8: Nov 18 '05

re: HOWTO: Include Style Sheet Links in the ASCX Controls?


....

"Don Wash" <don@wash.com> wrote in message
news:eLioPMpjEHA.140@TK2MSFTNGP12.phx.gbl...[color=blue]
> 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
>
>[/color]


Closed Thread