Adding metadata to MasterPage contentPlaceholder page.

Posted on 2006-05-16
Last Modified: 2010-05-18
I tried the following based on "Pro ASP.Net 2.0 in C#" recommendation.

in the content page code behind

Page masterPage = base.Master.Page

masterPage.Header.Metadata.Add("Keywords", "great,cool, etc");

The problem is that once I access header, .Metadata is not available.  Was this removed from the release of the 2.0 framework( oh yeah Im using the 2.0 framework)?  If so how do I do add metadata to a MastePage, Content Place Holder page?

Thanks in advance.
Question by:bisysweb
    1 Comment
    LVL 3

    Accepted Solution

    They removed this from 2.0.  The only way I can get around it is to use:

            Page masterPage = this.Master.Page;
            HtmlMeta _met = new HtmlMeta();
            _met.Name = "keywords";
            _met.Content = "great, cool, etc...";        

    Which works for me.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Suggested Solutions

    Title # Comments Views Activity
    sum28 challenge 31 82
    static class 3 44
    groovy example issue 10 32
    autoit - check if option is checked in another program 2 29
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now