views:

16

answers:

0

Hello,

I need a .vb class in App_Code in order to set metatags programmatically.

How can I change the following code to public shared sub?

 <script language = "vb" runat = "server">
Public Sub Page_Load(Sender As Object, E As EventArgs)


Dim hm As New HtmlMeta(ByVal hmName As String, ByVal hmContent As String)

    Dim head As HtmlHead = CType(Page.Header, HtmlHead)

    hm.Name = hmName 

    hm.Content = hmContent 

    head.Controls.Add(hm)

end sub
</script>

The main problem is how to declare head? CType(Page.Header, HtmlHead doesn't work.

thx in advance...