I\'m trying to programmatically add a . It is working fine when there is a
Head
element with runat = \"server\"
in the
Try moving whatever it is that you are doing in the <% .... %> to the code-behind. If you are using the script to add content into the page, you can replace it with an asp:Literal control and then set the value you were previously calculating in the script block to the code-behind and set Literal.Text to that value.