Is it possible to do something like this in a head tag, of master page, which has runatserver:
Remove the runat="server" attribute on the opening head tag. This way the asp.net inline code is correctly rendered.