473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

AddParsedSubObject breaks after upgrading to VS.NET 2005 RC

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
Nov 19 '05 #1
2 985
On Tue, 25 Oct 2005 13:12:25 -0400, "Steve Franks"
<pl****@postreplyhere.com> wrote:
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);
}


Use Page.Header.Controls.Add(metadata);. Exposing AddParsedSubObject
in beta2 was a flaw.

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/
Nov 19 '05 #2
Thanks - worked like a charm. I really appreciate the help.

Steve
Use Page.Header.Controls.Add(metadata);. Exposing AddParsedSubObject
in beta2 was a flaw.
--
Scott
http://www.OdeToCode.com/blogs/scott/

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mike Owen | last post by:
Hi, I have just used the import Wizard to import a VS 2003 app to VS 2005. I have a lot of work to do to enable it to compile successfully with all the errors and warnings it gave me, but as a...
4
by: Spurry Moses | last post by:
I know it's in Beta 2, but I can't report any good experiences with upgrading a project form 2003 to 2005. I tried to upgrade a 2003 project to C# Express 2005. My application has hardly...
8
by: Bill Henning | last post by:
Another developer and I have noticed that after upgrading to the ASP.NET 2.0 RTM release, when using: FormsAuthentication.SetAuthCookie(userName, true) That the cookie is no longer persisted,...
2
by: Kyle Slovensky | last post by:
I have some rather large programs written in VB .net. I've been trying to find some information as to if they need to be upgraded to VB .net 2005 and how that would be done. I've been looking...
15
by: Asaf | last post by:
Hi, I have received a source code project written in C++ VS.NET 2003 on .NET 1.1 that compiles without a problem. I have opened this source code in VS.NET 2005 and the Log wizard says that...
9
by: Greg P | last post by:
Could someone point me to a good guide for upgrading an existing vb6 application to vb 2005? I now know that my use of control arrays will need to be adjusted, does the wizard to this for me? ...
15
by: Joseph Geretz | last post by:
OK, I'll admit it up front - I just don't get it. Here's our previous VS2003 development model. Developers develop the WS solution on their own workstations, using their own IIS web servers...
2
by: carl.clawson | last post by:
I have a package of COM objects written in C++ in version 6. It is installed separately and shared by several applications. Then I have a .NET application written in VS2005 that uses these objects....
14
by: tezza | last post by:
I have a floated image and some paragraph text in a fluid box. It works beautifully, but only when the text extends beyond the image. Could someone take a look at my source please and tell me how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.