S
Simon Gorski
Hello Amir,
I'd use a literalControl:
<head>
<asp:Literal id="styles" runat="server"></asp:Literal>
</head>
Or a protected variable:
Dim Protected _styleSheet As String
_styleSheet = "<LINK href=Stylesone.css type=text/css>"
<head>
<%= styleSheet %>
protected System.Web.UI.HtmlControls.HtmlControl myhead;
mfg simo g.
Amir Eshterayeh said:Dear Friends
I want to change the name of my css file dynamically so
as Mr. Jos Branders helped me, I can change the <head> tag into an HTML
control like this:
<head id="myhead" runat="server">
...permanent content here...
</head>
so that I can modify it from code like this:
Sub Page_Load(sender As Object, e As EventArgs)
myhead.InnerHtml &="<LINK href=""Stylesone.css"" type=""text/css""
rel=""stylesheet"">"
End Sub
But when I run the code, I got this error:
The type or namespace name 'myhead' could not be found (are you missing a
using directive or an assembly reference?)
I'd use a literalControl:
<head>
<asp:Literal id="styles" runat="server"></asp:Literal>
</head>
Or a protected variable:
Dim Protected _styleSheet As String
_styleSheet = "<LINK href=Stylesone.css type=text/css>"
<head>
<%= styleSheet %>
You have to declare the myhead in the code-behind:But when I run the code, I got this error:
The type or namespace name 'myhead' could not be found (are you missing a
using directive or an assembly reference?)
protected System.Web.UI.HtmlControls.HtmlControl myhead;
mfg simo g.