You can - for example from the code of your custom server control - add a htmlgeneric control to the containing page header control like this:
string sInclude = "~/specialincludes/blabla.js";
sInclude = ResolveUrl( sInclude );
HtmlGenericControl Include = new HtmlGenericControl("script");
Include.Attributes.Add("type", "text/javascript");
Include.Attributes.Add("src", sInclude);
this.Page.Header.Controls.Add(Include);
and that would make the resulting html code look like this:
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" src="/thesite/specialincludes/blabla.js">
</script>
<head>
No comments:
Post a Comment