469,299 Members | 2,088 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

HOWTO: Include Style Sheet Links in the ASCX Controls?

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
Nov 18 '05 #1
7 10633
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" <do*@wash.com> wrote in message
news:eL*************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #2
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" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:es**************@TK2MSFTNGP15.phx.gbl...
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" <do*@wash.com> wrote in message
news:eL*************@TK2MSFTNGP12.phx.gbl...
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


Nov 18 '05 #3
....

"Don Wash" <do*@wash.com> wrote in message
news:eL*************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #4
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" <do*@wash.com> wrote in message
news:O$**************@TK2MSFTNGP15.phx.gbl...
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" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:es**************@TK2MSFTNGP15.phx.gbl...
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" <do*@wash.com> wrote in message
news:eL*************@TK2MSFTNGP12.phx.gbl...
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



Nov 18 '05 #5
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" <do*@wash.com> wrote in message
news:O$**************@TK2MSFTNGP15.phx.gbl...
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" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:es**************@TK2MSFTNGP15.phx.gbl...
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" <do*@wash.com> wrote in message
news:eL*************@TK2MSFTNGP12.phx.gbl...
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



Nov 18 '05 #6
....

"Don Wash" <do*@wash.com> wrote in message
news:eL*************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #7
....

"Don Wash" <do*@wash.com> wrote in message
news:eL*************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by blue | last post: by
2 posts views Thread by Herb Stull | last post: by
3 posts views Thread by David Freeman | last post: by
6 posts views Thread by tshad | last post: by
4 posts views Thread by Gopalan | last post: by
1 post views Thread by tshad | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.