S
Steve Franks
Hi All,
The following code was working just fine in Visual Studio 2005 Beta 2, but
breaks now that I've upgraded to the RC build:
public void setMetaValues(string metaKey, string metaVal)
{
HtmlMeta metadata = new HtmlMeta();
metadata.Attributes.Add(metaKey, metaVal);
Page.Header.AddParsedSubObject(metadata);
}
That compiles just fine in Beta 2, but in the RC build I get this on the
Page.Header.AddParsedSubObject line::
Compiler Error Message: CS1540: Cannot access protected member
'System.Web.UI.Control.AddParsedSubObject(object)' via a qualifier of type
'System.Web.UI.HtmlControls.HtmlHead'; the qualifier must be of type
'MyTemplate' (or derived from it)
NOTE: "MyTemplate" is the name of my masterpage. The setMetaValues method
shown above is declared inside of the codebehind of my MyTemplate
masterpage.
Can someone please let me know what I'm doing wrong and how to make this
same type of thing work in the RC build? I noticed that AddParsedSubObject
no longer comes up in Intellisense when I press the "." after Page.Header so
something in the API must have changed - not sure what the correct new
approach is though.
Basically I'm just looking to be able to easily add a "keywords" and
"description" tag to the meta info sent in a web page. In case it matters, I
have multiple levels of masterpages involved. For instance MyTemplate2 is a
master page that inherits from MyTemplate, and from a webform created from a
MyTemplate2 master page I need to be able to set these header values.
Thanks,
Steve
The following code was working just fine in Visual Studio 2005 Beta 2, but
breaks now that I've upgraded to the RC build:
public void setMetaValues(string metaKey, string metaVal)
{
HtmlMeta metadata = new HtmlMeta();
metadata.Attributes.Add(metaKey, metaVal);
Page.Header.AddParsedSubObject(metadata);
}
That compiles just fine in Beta 2, but in the RC build I get this on the
Page.Header.AddParsedSubObject line::
Compiler Error Message: CS1540: Cannot access protected member
'System.Web.UI.Control.AddParsedSubObject(object)' via a qualifier of type
'System.Web.UI.HtmlControls.HtmlHead'; the qualifier must be of type
'MyTemplate' (or derived from it)
NOTE: "MyTemplate" is the name of my masterpage. The setMetaValues method
shown above is declared inside of the codebehind of my MyTemplate
masterpage.
Can someone please let me know what I'm doing wrong and how to make this
same type of thing work in the RC build? I noticed that AddParsedSubObject
no longer comes up in Intellisense when I press the "." after Page.Header so
something in the API must have changed - not sure what the correct new
approach is though.
Basically I'm just looking to be able to easily add a "keywords" and
"description" tag to the meta info sent in a web page. In case it matters, I
have multiple levels of masterpages involved. For instance MyTemplate2 is a
master page that inherits from MyTemplate, and from a webform created from a
MyTemplate2 master page I need to be able to set these header values.
Thanks,
Steve