I'm using this bit of code to add a CSS link in the head section :
<script runat="server">
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
Dim oCSS As Control = Me.Page.FindControl("CSS")
If Not oCSS is Nothing Then
Dim oLink As New HtmlGenericControl("link")
oLink.Attributes("id") = "MyCss"
oLink.Attributes("rel") = "stylesheet"
oLink.Attributes("type") = "text/css"
oLink.Attributes("href") = SkinPath & "MyCss.css"
oCSS.Controls.AddAt(0, oLink)
End if
End Sub
</script>
It works, but the problem is that this places the CSS link on top of all other links in the HEAD section. Is there a way to make this link appear at the bottom of all other CSS links ?
Better still, can it be placed after a particular CSS link already in the head section ?
Also, how does they Controls.AddAt(0, oLink) work. It does not accept any other number other than "0" for the index.
Thank you in advance, :).