The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
just put the javascript inside your aspx page only. but shift it inside body tag. Remove it from code behind. You need to put all the meta related information inside page_load. Don't forget to put .visible=true at the end of it.