473,387 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 10876
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: blue | last post by:
My app draws a bunch of tables on the page and has a form for the user to enter data and submit. The form is contained within a User Control called DecisionCtl. When they submit the form, a bunch...
2
by: Herb Stull | last post by:
I'm trying to give users a choice of the visual interface used in my ASP.NET application using Cascading Style Sheets. Ideally I'd like to offer them several choices for backgrounds, fonts, etc....
3
by: David Freeman | last post by:
Hi There! I'm having trouble dynamically adding custom controls. My custom controls does not use code-behind but only <script /> block for programming. So as a result, I don't need to compile my...
6
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file =...
4
by: Gopalan | last post by:
Hi I want to use the <link href="...." type="..."> tag inside the .aspx file. This style is used by the user control (converting an existing aspx file to ascx file) which are added to this aspx...
9
by: Max Weebler | last post by:
Hi, I have a datagrid built that has an alternating item style that sets the backcolor and ForeColor of its rows. I have 4 template columns. One of them has a LinkButton embedded in it to...
3
by: Larry | last post by:
Hi, I need a method to dynamically include a server side include in my asp.net page. The problem is, the include file contains asp.net controls, and I can't find a way to get the controls to...
1
by: tshad | last post by:
If I have a User Control with tables in it and a Css Style sheet defined in the .aspx file - will the style sheet apply to the User Control (.ascx file)? If that is the case, if I have a style...
4
Frinavale
by: Frinavale | last post by:
So a while ago I created a Tab Strip Control (before the AjaxToolkit had theirs otherwise I would have probably just used theirs). When I looked at the AjaxToolkit control to see how they got...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.