You need to expose it as a property to use it on the markup.
In the code-behind:
Private _useCss As Boolean
Public Property UseCss() As Boolean
Get
Return _useCss
End Get
Set(ByVal value As Boolean)
_useCss = value
End Set
End Property
Then in the markup:
<% If UseCss = True Then %>
Your stylesheet link tag here
<% Else %>
else could be optional if you won't load anything
<% End If %>
Alternately you could have:
<% If UseCss = True Then
Response.Write("text")
Else
Response.Write("something else")
End If
%>
Another option is to give your head
tag an id and programmatically add the CSS file to it. To do this you don't need a property and could use the variable directly.
In your markup:
<head runat="server" id="head">
<%-- whatever you typically place here --%>
</head>
In your code-behind, for example on page load:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If useCss Then
Dim stylesheet As New HtmlGenericControl("link")
stylesheet.Attributes.Add("rel", "stylesheet")
stylesheet.Attributes.Add("type", "text/css")
stylesheet.Attributes.Add("href", "../css/myCssFile.css")
FindControl("head").Controls.Add(stylesheet)
End If
End Sub