No more Metadata collection

Published 27 April 06 11:57 PM | despos

In my ASP.NET 2.0 Core Reference book, much of the information on pages 133-135 appears to be incorrect.

In particular, speaking of the HtmlHead control I talk about a Metadata member that is no longer there. To add a new meta tag, you have to create a new HtmlMeta control and add it to the Controls collection of the HtmlHead control. This technique is described in the book as an alternate technique whereas it is in the final version of ASP.NET 2.0 the only viable route.

At a closer inspection, I would say that the team completely changed the implementation of the HtmlHead control, as it does not implement the IPageHeader interface that is also mentioned in the book. Now HtmlHead inherits HtmlGenericControl and exposes a Stylesheet and Title property. Here's the Visual Basic .NET code you need to add a meta tag programmatically:

Private Sub AddPageExitMetaTag()
        Dim meta As New HtmlMeta
        meta.HttpEquiv = "Page-Exit"
        meta.Content = "progid:DXImageTransform.Microsoft.Fade(duration=.4)"
        If Not Me.Header Is Nothing Then
            Me.Header.Controls.Add(meta)
        End If
End Sub

To remove existing meta tags, you should locate them in the Controls collection and remove using the Remove method on the ControlCollection class.

PS: Credits go to Sam for pointing this out.

Comments

# Xanax said on May 16, 2006 06:16 AM:

Nice design. Some people have acquired this opinion as other paradoxicalopinions have been acquired; when men cannot refute eristicalarguments, they give in to the argument and agree that theconclusion is true.

# xanax said on May 20, 2006 01:35 AM:

Cool design, but very light. Forno attribute can attach to them; for even to numbers quality is saidto belong after quantity.

# xanax said on May 20, 2006 01:35 AM:

Cool design, but very light. For whether unity is not asubstance or there is a unity-itself, number cannot be a substance.

# xanax said on May 20, 2006 01:35 AM:

Good site. while we may supposethat no even number is prime, we may suppose that some are and someare not.

# xanax said on May 20, 2006 01:36 AM:

Hi. Socrates the white hasnot yet another accident; for no unity can be got out of such a sum.Nor again (b) will 'white' have another term accidental to it, e.g.'musical'.

# xanax said on May 20, 2006 01:36 AM:

Hi, all!So too (4) in the case of passivity--(5) Thestates in virtue of which things are absolutely impassive orunchangeable, or not easily changed for the worse, are calledpotencies; for things are broken and crushed and bent and in generaldestroyed not by having a potency but by not having one and by lackingsomething, and things are impassive with respect to such processesif they are scarcely and slightly affected by them, because of a'potency' and because they 'can' do something and are in some positivestate.

# xanax said on May 20, 2006 01:36 AM:

Good site. But yet so far at least he alone speaks consistently;for he does not make some things perishable and others imperishable,but makes all perishable except the elements.

# xanax said on May 20, 2006 01:36 AM:

Hi. 24 'To come from something' means (1) to come from something asfrom matter, and this in two senses, either in respect of thehighest genus or in respect of the lowest species; e.g.

# xanax said on May 20, 2006 01:36 AM:

Nice site. Onekind of predicate is not propter se because the term that is beingdefined is combined with another determinant, e.g.

# xanax said on May 20, 2006 01:36 AM:

Cool design, but very light. 'Apart' may be a part either of the form (i.e.

# xanax said on May 21, 2006 06:35 AM:

Nice site. Hence when all such inventionswere already established, the sciences which do not aim at givingpleasure or at the necessities of life were discovered, and first inthe places where men first began to have leisure.

# xanax said on May 21, 2006 06:35 AM:

Nice site. Yet they do not all agree as to the number and the nature of theseprinciples.

# xanax said on May 21, 2006 06:35 AM:

Hi, all!neither the woodnor the bronze causes the change of either of them, nor does thewood manufacture a bed and the bronze a statue, but something elseis the cause of the change.

# xanax said on May 21, 2006 06:35 AM:

Nice design. If, then, there is something in what the poetssay, and jealousy is natural to the divine power, it would probablyoccur in this case above all, and all who excelled in this knowledgewould be unfortunate.

# xanax said on May 21, 2006 06:35 AM:

Hi. Yet they do not all agree as to the number and the nature of theseprinciples.

# xanax said on May 21, 2006 06:35 AM:

Nice design. the bee, andany other race of animals that may be like it; and those which besidesmemory have this sense of hearing can be taught.

# xanax said on May 21, 2006 06:35 AM:

Nice site. But for those who make moreelements it is more possible to state the second cause, e.g.

# xanax said on May 21, 2006 06:35 AM:

Nice site. An indication of this is thedelight we take in our senses; for even apart from their usefulnessthey are loved for themselves; and above all others the sense ofsight.

# xanax said on May 21, 2006 06:35 AM:

Cool design, but very light. But as more arts wereinvented, and some were directed to the necessities of life, others torecreation, the inventors of the latter were naturally always regardedas wiser than the inventors of the former, because their branches ofknowledge did not aim at utility.

# micoud said on January 5, 2008 11:39 AM:

Thanks for this update.

Leave a Comment

(required) 
(required) 
(optional)
(required)