One possibility is to not declare the link. Instead, have a Literal control
where the link would go, and then set it's .Text property in your
code-behind. Your code behind could use whatever logic makes sense in your
application and that logic could insert the link when necessary otherwise
insert nothing. If your page's code-behind is aware of the asxc that it will
be hosting, that "knowledge" could be used to know when to insert the link
and when to not insert it (as just one way to go about this).
//This goes in your aspx <HEAD>:
<asp:Literal id="litCSSFileName" EnableViewState="False"
runat="server"></asp:Literal>
//Then you Page_Load logic could conditionally do something like this:
litCSSFileName.Text = strCssLink;
//Resulting in something like this at runtime in place of the Literal
declaration:
<LINK href="/MyApp/SubFolder/MyCssFile.css" type="text/css"
rel="stylesheet">
-HTH
BTW: It's considered bad etiquette to post same question to multiple news
groups.
"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:Ov**************@TK2MSFTNGP15.phx.gbl...
I have user controls that contain a link to a stylesheet. Several of my
pages also have a link to this same stylesheet. Because of this, the
resulting output contains multiple links to the same stylesheet. Although
this does not cause any harm as far as how the page looks, it is
unnecessary and makes the download take slightly longer. Is there any easy
way to avoid having the same stylesheet link added multiple times? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/