Inject ")`. – Tarik Aug 31 '11 at 21:17

  • 1
    Durn! Try this one `page.Header.Controls.Add(new Literal("")` – Tarik Aug 31 '11 at 21:29
  • The Header property on "page" is null so I can't access the "Controls" property. Is this a lifecycle problem? – Brian David Berman Aug 31 '11 at 21:33
  • I am sorry there is something wrong with my code, I will try to come up with something working properly. – Tarik Sep 01 '11 at 14:26
  • I know i'm late, but for Page.Header to work, your head tag must be marked by "runat=server" attribute. – Ahmed Mar 28 '12 at 07:35
  • 0

    Check this out. It can be adapted to add to a master page too.

    http://msdn.microsoft.com/en-us/library/z9h4dk8y.aspx

    Jason James
    • 1,082
    • 1
    • 14
    • 27