I have a simple master page, nothing too fancy in there, and have a content page that inheirts from a page base class. Reason for the base class is to move the view state down to the bottom of the page. All that seems to work the way I want, so no issue there.
Issue comes when I am trying to setup a routine where I can call from any page and add metadata to my page rendered. In my page base class I have a method called AddPAgeMetaData and the code is attached. In the page load event of the content page I have the following piece of code.
, "some key words", Page.Header)
on", "some description", Page.Header)
Page.Header is always nothing and I am not sure why that is the case, because I could have sworn when playing around with this on my laptop at home, I was able to get this working. I have tried to do this a number ways, as in taking out the call to the page base class, but still get the same result. If anyone has any ideas on what is going on here, please let me know.
In the function call you may notic swuh, this is simple the following at the top of the page base class:
Imports swuh = System.Web.UI.HtmlControls
Public Function AddPageMetaData(ByVal strKeyName As String, ByVal strKeyValue As String, ByVal pgHeader As swuh.HtmlHead) As Boolean
Dim blnReturn As Boolean = True
Dim pgMetaData As New swuh.HtmlMeta
Dim ltrNewLine As New Literal
Const cstrPROC_FUNC_NAME As String = _cstrMODULE_NAME & ".AddPageMetaData"
.Text = Environment.NewLine
.Name = strKeyName
.Content = strKeyValue
'Create the meta data value
Catch ex As Exception
pgMetaData = Nothing
ltrNewLine = Nothing