For external script sources you can use this :
if (!ClientScript.IsClientScriptIncludeRegistered("externalResuorce"))
{
ClientScript.RegisterClientScriptInclude("externalResuorce",
"scripts/myscripts.js");
}
But for stylesheet files, you can use this :
HtmlLink link = new HtmlLink();
link.Href = "main.css";
link.Attributes["type"] = "text/css";
link.Attributes["rel"] = "stylesheet";
Page.Header.Controls.Add(link);
and to control maybe you should loop Page.Header.Controls collection and look for a HtmlLink that has main.css href.
EDIT : Also this might help for finding your literal control in header's controls collection :
Page.Header.FindControl("your_literals_id");
Canavar
2009-03-12 12:07:42